I have been seeing some repos with Dockerfile.dev. The contents are very similar to a regular Dockerfile.
What is the difference between these two and what is the purpose of Dockerfile.dev?
The Dockerfile is the starting point for creating a Docker image. The file format provides a well-defined set of directives that allow you to copy files or folders, run commands, set environment variables, and do other tasks required to create a container image.
Difference between docker-compose and Dockerfile. The key difference between the Dockerfile and docker-compose is that the Dockerfile describes how to build Docker images, while docker-compose is used to run Docker containers.
Every-time you run docker commit , you will create a new image. On the other hand, docker build create the image by referring to a script (Dockerfile). Generally, docker build will only create a new image if it detects changes.
A Dockerfile is a recipe for creating Docker images. A Docker image gets built by running a Docker command (which uses that Dockerfile ) A Docker container is a running instance of a Docker image.
It is a common practice to have seperate Dockerfiles for deployments and development systems.
You can define a non default dockerfile while building:
docker build -f Dockerfile.dev -t devimage .
One image could use a compiled version of the source, and a other image could mount the /src folder into the system for live updates.
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