Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add an example for configuring a custom DockerContainer with exposed port and environment variale #711

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vemonet
Copy link

@vemonet vemonet commented Oct 3, 2024

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
Copy link

Yourgene commented Dec 9, 2024

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")

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

Successfully merging this pull request may close these issues.

3 participants