Creating docker images from the source directory using different dock files

My goal is to create several different docker images from the same source code.

I have a folder. / src (project node.js). inside. / src I have a first.dockerfile and a second docker file.

I use this standard command line to build a project

sudo docker build -t doronaviugy/myproject .

This works without problems using the standard Dockerfile

I am trying to create it from a specific docker file using the line

sudo docker build -t doronaviguy/myproject  - <   first.docker

this line works, but now the path is not copied inside the image

#Inside the Dockerfile
ADD . /src

I think I understand how to specify the dockerfile argument, but I need to specify the directcotry argument to copy inside the docker image.

Many thanks.

+4
1

Docker 1.5 -f Docker , :

docker build -t doronaviugy/myproject -f dockerfiles/first.docker .

stdin ( - < first.docker), , COPY ADD, .

Docker, , Dockerfiles Dockerfile , docker build.

+8

All Articles