我使用官方的nginx docker镜像 (https://registry.hub.docker.com/_/nginx/)。当我修改Index.html文件时,我没有看到我的更改。在nginx.conf中设置sendfile off
也没有帮助。
只有重新构建镜像我才能看到更改。
以下是我的Dockerfile:
FROM nginx
COPY . /usr/share/nginx/html
COPY nginx/nginx.conf /etc/nginx/nginx.conf
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
这是我用来构建和运行它的命令:
docker build -t some-nginx .
docker run --name app1 -p 80:80 -v $(pwd):/user/share/nginx/html -d some-nginx
Thank you