Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

docs: example for configuring a custom DockerContainer#711

Open
vemonet wants to merge 3 commits into
testcontainers:main from
vemonet:improve-docs
Open

docs: example for configuring a custom DockerContainer #711
vemonet wants to merge 3 commits into
testcontainers:main from
vemonet:improve-docs

Conversation

@vemonet

@vemonet vemonet commented Oct 3, 2024

Copy link
Copy Markdown

Current examples for running a DockerContainer are all using with DockerContainer (3 examples out of 3).

But this is not the right way when someone wants to add some custom configuration (expose a port, define an environment variable), which is quite a regular use-case.

Newcomers reading this docs might get confused and will need to go through the process of finding out how to do this properly outside of the docs (e.g. this guy here #709 )

So I have added a basic example, feel free to change the docker image/port for something else

Yourgene commented Dec 9, 2024

Copy link
Copy Markdown

Hi, I had the same "issue" as you few days ago, and I had to look into code to find out that DockerContainer class is much rich than what is displayed in docs.
Thanks for adding it!

If I had a suggestion, I'd also add the volume mapping example, just for the sake of it. Volume mapping is a basic use case too, as the ones you provided.
If needed, here's the line you could add:

.with_volume_mapping('/path/to/host/dir/', "path/to/container/dir")
vemonet reacted with thumbs up emoji

@Tranquility2 Tranquility2 changed the title (削除) docs: Add an example for configuring a custom DockerContainer with exposed port and environment variale (削除ここまで) (追記) docs: example for configuring a custom DockerContainer (追記ここまで) Jun 29, 2025

Copy link
Copy Markdown
Contributor

Looks like this needs some more work

vemonet commented Jul 8, 2025

Copy link
Copy Markdown
Author

@Tranquility2 it's litterally 10 lines in a readme of the most basic example of how most people will use this lib

Should not be too hard to get right no?

Note the one I wrote was almost a year ago, so the lib might have evolved since then

Josephrp reacted with laugh emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Tranquility2 Tranquility2 Awaiting requested review from Tranquility2

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /