nginx - 已经构建过的镜像,我修改了配置文件,再次构建的时候,运行容器的时候没有,配置没有起作用

【字号: 日期:2023-02-17浏览:51作者:雯心

问题描述

我的项目地址:https://github.com/caojianx/j...这是nginx 下的Dockerfile代码

From nginx:latestCOPY conf /etc/nginx/ADD default_conf /etc/nginx/conf.d/ADD project /usr/share/nginx/html/

之前构建过了,然后我修改了配置之后,重新构建镜像,在容器里运行还是没有用,以下是构建日志查看构建日志

1docker image building is started ...2[ fetch stage begin.]3fetch dockerfile and context4HEAD is now at cbdd606... s5[fetch successfully.]6==========================================7[docker version.]8Client:9 Version: 1.13.110 API version: 1.2611 Go version: go1.7.512Git commit: 092cba313 Built: Wed Feb 8 06:38:28 201714 OS/Arch: linux/amd6415Server:16 Version: 1.13.117 API version: 1.26 (minimum version 1.12)18 Go version: go1.7.519 Git commit: 092cba320 Built: Wed Feb 8 06:38:28 201721 OS/Arch: linux/amd6422 Experimental: false23==========================================24[docker build stage begin.]25Sending build context to Docker daemon 14.34 kB26Step 1/4 : FROM nginx:latest27latest: Pulling from library/nginx28Digest: sha256:e6693c20186f837fc393390135d8a598a96a833917917789d63766cab6c5958229Status: Image is up to date for nginx:latest30 ---> 5766334bdaa031Step 2/4 : COPY conf /etc/nginx/32---> 4be9a698b02733Removing intermediate container 849a4ba53f5134Step 3/4 : ADD default_conf /etc/nginx/conf.d/35---> 5b2c328bf32536Removing intermediate container 5240bc88c6ac37Step 4/4 : ADD project /usr/share/nginx/html/38---> 260a4255fdf339Removing intermediate container 7b946e1921cc40Successfully built 260a4255fdf341[ build successfully.]42==========================================43[push stage begin.]44docker push registry-internal.cn-hangzhou.aliyuncs.com/caojx_home/nginx:latest45The push refers to a repository [registry-internal.cn-hangzhou.aliyuncs.com/caojx_home/nginx]46714139c33233: Preparing477be11ed49a03: Preparing48ad7f5e4eca75: Preparing4997b903fe0f6f: Preparing5031fc28b38091: Preparing51aca7b1f22e02: Preparing525d6cbe0dbcf9: Preparing53aca7b1f22e02: Waiting545d6cbe0dbcf9: Waiting5531fc28b38091: Layer already exists5697b903fe0f6f: Layer already exists57aca7b1f22e02: Layer already exists585d6cbe0dbcf9: Layer already exists59ad7f5e4eca75: Pushed607be11ed49a03: Pushed61714139c33233: Pushed62latest: digest: sha256:c93d3da96d534b55307a38a2fc19039ede9fbfa07a9a7d82ef80cd037884fb0e size: 177763[push successfully.]64{'exitCode':0, 'message':'fetch build push successfully'}

问题解答

回答1:

我自己解决了,重新部署一遍就好了

相关文章: