Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a Dockerfile.dev and how is it different from Dockerfile

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?

like image 969
Nicky Feller Avatar asked Aug 23 '16 06:08

Nicky Feller


People also ask

What is a 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.

What is difference between Docker compose and Dockerfile?

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.

What do you mean by Dockerfile & how it is different from Commit?

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.

What is the difference between Dockerfile and Docker image?

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.


1 Answers

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.

like image 153
opHASnoNAME Avatar answered Oct 05 '22 15:10

opHASnoNAME