-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Support docker context #2036
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
Support docker context #2036
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @skagedal ! I have left some comments. Indeed, this is something we would like to support
docker-java-core/src/main/java/com/github/dockerjava/core/DefaultDockerClientConfig.java
Outdated
Show resolved
Hide resolved
docker-java-core/src/main/java/com/github/dockerjava/core/DockerContextMetaFile.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution @skagedal! I've left a few suggestions.
docker-java-core/src/main/java/com/github/dockerjava/core/DockerContextMetaFile.java
Outdated
Show resolved
Hide resolved
docker-java-core/src/main/java/com/github/dockerjava/core/DockerContextMetaFile.java
Outdated
Show resolved
Hide resolved
docker-java/src/test/java/com/github/dockerjava/core/DockerClientBuilderTest.java
Outdated
Show resolved
Hide resolved
docker-java-core/src/main/java/com/github/dockerjava/core/DefaultDockerClientConfig.java
Outdated
Show resolved
Hide resolved
docker-java-core/src/main/java/com/github/dockerjava/core/DockerContextMetaFile.java
Outdated
Show resolved
Hide resolved
docker-java-core/src/main/java/com/github/dockerjava/core/DockerContextMetaFile.java
Outdated
Show resolved
Hide resolved
docker-java-core/src/main/java/com/github/dockerjava/core/DockerContextMetaFile.java
Outdated
Show resolved
Hide resolved
…erContextMetaFile.java Co-authored-by: Eddú Meléndez Gonzales <eddu.melendez@gmail.com>
…entBuilderTest.java Co-authored-by: Eddú Meléndez Gonzales <eddu.melendez@gmail.com>
Co-authored-by: Eddú Meléndez Gonzales <eddu.melendez@gmail.com>
Thanks for your contribution, @skagedal ! This is now merged in |
@eddumelendez I think #1946 can be closed now. |
Opening up this proof-of-concept pull request to support docker contexts. The end goal for me would be to be able to run testcontainers tests running in a Docker environment such as Colima without having to set specific environment variables like
DOCKER_HOST
and instead have it just work, but the use case can of course be other things.I know this isn't up to par to get merged, regarding code style and test coverage, but before I work any further I'd love to get just some input on whether the general idea is right.
So, what it does is that it's looking for the
currentContext
setting in the~/.docker/config.json
file and then matching that to the context description file in~/.docker/contexts/meta/
. This is briefly documented here but the details of the file format I have just inferred from looking at the files set up on my system.Implements issue #1946.