← All tasks
pythontestcontainers/testcontainers-python #610Not a task: already works

Bug: DockerImage path arg is misleading

envgap__testcontainers__testcontainers-python-610

01 / FAILURE SIGNATURE

As reported upstream

* see not too helpful error message from docker itself bubble up
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

Base commit
8045a806fcb6908567339a14f2f0d7a169461675
Manifest
pyproject.toml
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

testcontainers/testcontainers-python #610 · read the original issue
**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



```python

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
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]