Create a nginx docker container, how to edit the nginx.conf file and update it after mounting the container directory to the system directory

found a lot of information, including search SF already existed related problems, failed,

in fact, the problem I"m trying to solve right now is as follows:

execute the command: docker run-d-t-I-p 80:80-v / etc/nginx/conf:/usr/local/nginx/conf docker.io/nginx

on centos7.

start a nginx container (mount the container directory to the system-specified directory at the same time), access ip:80 works normally,
but I know how to edit the nginx.conf file and update the configuration without docker. In the current situation, how to edit the nginx.conf file and update the configuration takes effect? Which big curry can tell you how to operate it? tks

Apr.05,2021

provides a way to start nginx, in the form of service, then edit and add new nginx.conf files locally, then update service, to 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.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb4fd6-482df.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb4fd6-482df.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?