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?
You can also run a Docker image from your own Docker file using the docker-compose command. With compose, you can configure your application's services and then you can start all services with a single command. For example, set up a docker-compose. yml like this in your repository root (where the Dockerfile is):
A Dockerfile must be created with no extension. To do this in Windows, create the file with your editor of choice, then save it with the notation "Dockerfile" (including the quotes). For additional examples of Dockerfiles for Windows, see the Dockerfile for Windows repository.
If you want to access the image data directly, it's usually stored in the following locations: Linux: /var/lib/docker/ Windows: C:ProgramDataDockerDesktop. macOS: ~/Library/Containers/com.
The process to run Dockerfile is:
docker build . -t [tag] -f /path/to/Dockerfile
And then:
docker run -d tag
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With