Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send files as arguments of docker commands?

Tags:

docker

I'm not sure that I'm trying to do it the right way, but I would like to use docker.io as a way to package some programs that need to be run from the host.

However these applications take filenames as arguments and need to have at least read access. Some other applications generate files as output and the user expects to retrieve those files.

What is the docker way of dealing with files as program parameters?

like image 960
user2245644 Avatar asked Feb 03 '14 17:02

user2245644


People also ask

How do I pass args to ENTRYPOINT docker?

So if you want to pass the URL argument to ENTRYPOINT, you need to pass the URL alone. The reason is we have the ab command as part of the ENTRYPOINT definition. And the URL you pass in the run command will be appended to the ENTRYPOINT script. In this case, CMD instruction is not required in the Dockerfile.

How do I pass a variable in docker run?

With a Command Line Argument The command used to launch Docker containers, docker run , accepts ENV variables as arguments. Simply run it with the -e flag, shorthand for --env , and pass in the key=value pair: sudo docker run -e POSTGRES_USER='postgres' -e POSTGRES_PASSWORD='password' ...


1 Answers

Start Docker with a mounted volume and use this to directory to manipulate files.

See: https://docs.docker.com/engine/tutorials/dockervolumes/

like image 162
Mark O'Connor Avatar answered Sep 21 '22 15:09

Mark O'Connor