Describe the bug
testcontainers.core.image.DockerImage has a constructor arg path with the following docs:
path – Path to the Dockerfile to build the image
But actually this doesn't seem to be true. It's rather the context, the path to the directory to build in and the dockerfile itself must be named Dockerfile. Especially for testing this is very unhandy. I often have several dockerfiles in the same directory. I'd expect bein able to pass a context and the actual path to the dockerfile, like
with DockerImage(dockerfile="./caseA.Dockerfile", context=".", tag="casea:latest") as image:
pass
To Reproduce
- have a
test.Dockerfile
with DockerImage(path="./test.Dockerfile", tag="test") as image: ...
- see not too helpful error message from docker itself bubble up
Runtime environment
not relevant
P.S.: build-args would also be handy
Describe the bug
testcontainers.core.image.DockerImagehas a constructor argpathwith the following docs:But actually this doesn't seem to be true. It's rather the context, the path to the directory to build in and the dockerfile itself must be named
Dockerfile. Especially for testing this is very unhandy. I often have several dockerfiles in the same directory. I'd expect bein able to pass acontextand the actualpathto the dockerfile, likeTo Reproduce
test.Dockerfilewith DockerImage(path="./test.Dockerfile", tag="test") as image: ...Runtime environment
not relevant
P.S.: build-args would also be handy