dockerdockerfiledocker-image

Running a Docker file stored locally


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?


Solution

  • The process to run Dockerfile is:

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

    And then:

    docker run -d tag