Skip to content

Bug: DockerImage path arg is misleading #610

@black-snow

Description

@black-snow

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions