Expose docker.from_env() parameters
See original GitHub issuetestcontainers.core.DockerClient
calls docker.from_env()
it it’s constructor. This method has a few parameters that will be useful to be exposed (see reference)
Ideally testcontainers.core.DockerClient
and conversely testcontainers.core.DockerContainer
should expose these parameters.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Dockerfile reference - Docker Documentation
The FROM instruction specifies the Parent Image from which you are building. FROM may only be preceded by one or more ARG instructions,...
Read more >How do I pass environment variables to Docker containers?
The docker run command just reads the file, does very basic parsing and passes the values through to the container, it's not equivalent...
Read more >Expose Pod Information to Containers Through Environment ...
Use Pod fields as values for environment variables. In this part of exercise, you create a Pod that has one container, and you...
Read more >Environment variables are not applied on container build #1837
I see no options to pass env vars from .env.local to build context (( ... I really like the docker syntax and using...
Read more >How can I use environment variables in Nginx.conf
To avoid a very complex command parameter to the container (as in the linked example), you can write a Docker entrypoint script which...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That sounds reasonable. But let’s pass a dictionary
docker_client_kw
toDockerContainer
and then unpack the dictionary in the call toDockerClient
akin togridspec_kw
matplotlib.pyplot.subplots
.I think it could be useful to implement it this way but it doesn’t really abstract the Docker client which isn’t bad per-se if the project’s scope is limited only to Docker and not other kind of containers (BSD Jails could be useful for example). However, we do need to consider that we might switch from the official docker client at some point since it may be phased out or since Docker Inc will unexpectedly go bankrupt etc.
I admit these risks are rather minor, but violating encapsulation needs better reasons than useful.
The design we’re looking for is the ability to pass a ContainerClientConfiguration object which we can use for testing by mocking the object, provide configuration to multiple container implementations and maybe something I haven’t thought of.