How to name Dockerfiles
dev.Dockerfile
, test.Dockerfile
, build.Dockerfile
etc.
On VS Code I use <purpose>.Dockerfile
and it gets recognized correctly.
[Please read the full answer]Don't change the name of the dockerfile if you want to use the autobuilder at hub.docker.com. Don't use an extension for docker files, leave it null. File name should just be: (no extension at all)
Dockerfile
However, now you can name dockerfiles like,
test1.Dockerfile
$ docker build -f dockerfiles/test1.Dockerfile -t test1_app .
or
Dockerfile.test1
$ docker build -f dockerfiles/Dockerfile.test1 -t test1_app .
This will also work.
If you handle multiple files that live in the same context, you could use STDIN:
test1.Dockerfile
$ docker build -t test1_app - < test1.Dockerfile