ConnerWithAnE
ConnerWithAnE

Reputation: 1158

Have command line available upon running Dockerfile

I just can't seem to find exactly how to have a command line available when starting a Dockerfile. Is there a certain parameter I can set inside the Dockerfile which will give a command line upon starting the image within a Docker container?

Upvotes: 0

Views: 113

Answers (2)

Makariy
Makariy

Reputation: 795

When you run a container you can add option -it

docker run -it some/image:tag

From docs:

For interactive processes (like a shell), you must use -i -t together in order to allocate a tty for the container process. -i -t is often written -it as you’ll see in later examples. Specifying -t is forbidden when the client is receiving its standard input from a pipe, as in

Upvotes: 0

ConnerWithAnE
ConnerWithAnE

Reputation: 1158

Ah it is a very simple solution

CMD ["/bin/bash"]

Upvotes: 1

Related Questions