Reputation: 85
I have nginx.conf file on our artifactory (http://artifactory.abc.com). I want to dowload and replace the file (/etc/nginx/nginx.conf) inside the container when the container is launched so that I do not have to rebuild the Dockerfile each time I make a change to my nginx.conf file. I can just upload the modified file to artifactory so how can I configure Dockerfile to do the same?
Upvotes: 2
Views: 1787
Reputation: 708
You can do a normal docker copy command after downloading file in your local
docker cp nginx.conf <container name/id>:/etc/nginx/nginx.conf
Upvotes: 2
Reputation: 7803
Use a read-only bind mount when running your container:
docker run --mount type=bind,source=/etc/nginx/nginx.conf,target=/etc/nginx/nginx.conf,readonly ...
Upvotes: 0