Running a Docker file stored locally

jz22 picture jz22 · Jun 16, 2017 · Viewed 23.9k times · Source

I have a docker file that includes a python script. So far I pushed it to my github and from there to my docker hub. Afterwards I used the command

docker pull name/repo

I would like to store the docker file I created with a text editor in a folder together with the python scrip and execute it with a command like

docker run c:/pathtodockerfile

Is that possible?

Answer

German picture German · Jun 16, 2017

The process to run Dockerfile is:

docker build . -t [tag] -f /path/to/Dockerfile

And then:

docker run -d tag