简体   繁体   中英

After downloading image from “Docker Hub”, where should I put my configuration file? In data volume?

I am using Docker for the first time.
I downloaded a Nginx image from "Docker Hub",
I don't know where I should put my configuration file.
Put in data volume?
I read the documentation,but I am confused.

You could write a Dockerfile and build you own image FROM nginx base.

Then you can COPY your default.conf to /etc/nginx/conf.d/default.conf.

Then you can build your image and run it.

Dockerfile (assumed Dockerfile and conf file are in the same folder):

FROM nginx:latest

COPY default.conf /etc/nginx/conf.d/default.conf

Build & run:

docker build -t myproxy:1.0
docker run -d -P myproxy

Then you can link the running container to another one, running your application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM