Looking for a lot of information, including searching for SF’s existing related problems, failed.
In fact, the problem I want to solve now is this:
Execute command: dockerrun-d-t-i-p80: 80-v/etc/nginx/conf:/usr/local/nginx/conf docker.io/nginx
Start a nginx container (at the same time mount the container directory to the specified directory of the system), access ip:80 works normally.
However, I know how to edit the nginx.conf file and update the configuration without docker. How to edit the nginx.conf file and update the configuration to take effect under the current situation? Which big man can tell us how to do it, tks
Provide a method, you can start nginx in the form of service, then edit it locally, add a new nginx.conf file, and update the service, then turn off the original container and restart a new container:
$ docker service create \ --name=mynginx \ --mount type=bind,source=/etc/nginx/nginx.conf,target=/etc/nginx/nginx.conf \ --publish published=80,target=80 \ nginx:alpine $ vi /etc/nginx/conf/nginx.conf $ docker service update mynginx
I hope I can help you.