My goal is to build several different docker images , from the same source code.
i have my ./src folder (node.js project). inside ./src i have first.dockerfile and seco
Since Docker 1.5, you can use the -f
argument to select the Dockerfile to use e.g:
docker build -t doronaviugy/myproject -f dockerfiles/first.docker .
If you use stdin to build your image ( the - < first.docker
syntax), you won't have a build context so you will be unable to use COPY
or ADD
instructions that refer to local files.
If you have to use an older version of Docker, you'll need to use some scripting to copy your specific Dockerfiles to Dockerfile
at the root of the build context before calling docker build
.