I have a container, and i have a json file where is some information to start my api.
The problem is that i need to deploy mutiple container with different json file
So here is my question as we do the COPY in dockerfile is there a way to copy a file into the container on the docker run.
The use of secret is not possible because my client doesn’t want to use swarm.
Thanks for reading
2
Answers
You could use the existing image as a base image, and add a new
Dockerfile
with the singleCOPY
step. Thendocker build
would add the new file.Alternatively — and this is how secrets and configmaps are implemented anyway — mount the file/folder with the
--mount
argument withdocker run
.Yes.
After you have your container running with docker run
Do a docker ps to get the docker container id or name and
https://docs.docker.com/engine/reference/commandline/cp/