第一步:Docker生成镜像
docker@default:~$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE metal-workbench-api-image latest a1ad98094180 7 hours ago 750MB
第二步:登陆至Docker
docker@default:~$ docker login Login 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: weschen Password: Login Succeeded
第三步:给现有镜像打tag
docker@default:~$ docker tag a1ad98094180 weschen/metal-workbench-api-image:1.0.0 docker@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-image The push refers to a repository [docker.io/weschen/metal-workbench-api-image] e36d859cca87: Pushed c926dd536114: Pushed d6b6b16c6c71: Pushed 6d3032715cbe: Pushed df95dc115bab: Pushed e5f36aeaca66: Pushed ae227185393e: Mounted from library/node d50f959eea7b: Mounted from library/node 677f02386f07: Mounted from library/node 7b3b4fef39c1: Mounted from library/node ecf5c2e2468e: Mounted from library/node bb07d0c1008d: Mounted from library/node 4902b007e6a7: Mounted from library/node 007ab444b234: Mounted from library/node 1.0.0: digest: sha256:ffb6f1b980d151c053565e4ff2b02b85acef3e662b60b96c210a8bbcbf165c95 size: 3257
到此,已经将最新的镜像推送至Docker Hub
需要更新时,直接下载相应的版本即可
Rancher原本有两个容器是使用本地的镜像的,如果需要升级,则需要更新至与Docker Hub一样的版本
升级过程