[root@ip-172-0-0-88 ~]# docker --version Docker version 19.03.3, build a872fc2f86
[root@ip-172-0-0-88 ~]# cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core)
FROM centos RUN rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm RUN yum -y install nginx CMD /bin/bash -c "echo 'hello' && exec nginx -g 'daemon off;'"
FROM centos RUN rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm RUN yum -y install nginx COPY ./lile_test / CMD /bin/bash -c "echo 'hello' && exec nginx -g 'daemon off;'"
docker build -f Dockerfile1 -t lile224/centos7_nginx:20191012 . docker push lile224/centos7_nginx:20191012
docker service create --name centos7_nginx lile224/centos7_nginx:20191012
docker build -f Dockerfile2 -t lile224/centos7_nginx:20191012 . docker push lile224/centos7_nginx:20191012
docker service update centos7_nginx --image lile224/centos7_nginx:20191012
[root@ip-172-0-0-111 ~]# docker service update centos7_nginx --image lile224/centos7_nginx:20191012 image lile224/centos7_nginx:20191012 could not be accessed on a registry to record its digest. Each node will access lile224/centos7_nginx:20191012 independently, possibly leading to different nodes running different versions of the image. centos7_nginx overall progress: 1 out of 1 tasks 1/1: running [==================================================>] verify: Service converged
原文出處:https://www.cnblogs.com/lemon-le/p/11675025.htmlhtml