第一步:Docker生成镜像
docker@default:~$ docker imagesREPOSITORY TAG IMAGE ID CREATED SIZEmetal-workbench-api-image latest a1ad98094180 7 hours ago 750MB
第二步:登陆至Docker
docker@default:~$ docker loginLogin with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.Username: weschenPassword:Login Succeeded
第三步:给现有镜像打tag
docker@default:~$ docker tag a1ad98094180 weschen/metal-workbench-api-image:1.0.0docker@default:~$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE metal-workbench-api-image latest a1ad98094180 7 hours ago 750MB weschen/metal-workbench-api-image 1.0.0 a1ad98094180 7 hours ago 750MB
第四步:推送镜像至Docker Hub
docker@default:~$ docker push weschen/metal-workbench-api-imageThe push refers to a repository [docker.io/weschen/metal-workbench-api-image]e36d859cca87: Pushedc926dd536114: Pushedd6b6b16c6c71: Pushed6d3032715cbe: Pusheddf95dc115bab: Pushede5f36aeaca66: Pushedae227185393e: Mounted from library/noded50f959eea7b: Mounted from library/node677f02386f07: Mounted from library/node7b3b4fef39c1: Mounted from library/nodeecf5c2e2468e: Mounted from library/nodebb07d0c1008d: Mounted from library/node4902b007e6a7: Mounted from library/node007ab444b234: Mounted from library/node1.0.0: digest: sha256:ffb6f1b980d151c053565e4ff2b02b85acef3e662b60b96c210a8bbcbf165c95 size: 3257
到此,已经将最新的镜像推送至Docker Hub
需要更新时,直接下载相应的版本即可
Rancher原本有两个容器是使用本地的镜像的,如果需要升级,则需要更新至与Docker Hub一样的版本
升级过程