3

I saw this question about multiple dockerfiles in project:

docker build -f Dockerfile.db .
docker build -f Dockerfile.web .

What does this mean? Is it one dockerfile with different "tags" in it? (if yes, is it possible to show a short example?) Or there is two dockerfiles in the repository with the names Dockerfile.db and Dockerfile.web?

Community
  • 1
  • 1

1 Answers1

2

These are two different dockerfiles. One for the database. And the other with the webserver.

Benjamin Schüller
  • 2,104
  • 1
  • 17
  • 29
  • so this is a new solution to get 2 dockerfiles in the same repository? –  Jan 18 '16 at 14:32
  • You can have two dockerfiles in the same directory for building images. But i prefer having one dockerfile in a directory with additional needed files. – Benjamin Schüller Jan 18 '16 at 14:57
  • 1
    Thanks. when I have 2 dockerfiles, is it possible to perform the build like this: docker build -f Dockerfile.db -t localhost:5000/test/test-db:${version} . ? –  Jan 18 '16 at 14:59
  • I didn't try it myself, but i would say "Yes". – Benjamin Schüller Jan 18 '16 at 15:00