Skip to content

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

Merged
merged 18 commits into from
Feb 7, 2023
Merged

Support docker context #2036

merged 18 commits into from
Feb 7, 2023

Conversation

skagedal
Copy link
Contributor

@skagedal skagedal commented Dec 28, 2022

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.

Copy link
Member

@eddumelendez eddumelendez left a 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

@eddumelendez eddumelendez self-assigned this Feb 3, 2023
@eddumelendez eddumelendez added this to the next milestone Feb 3, 2023
Copy link
Member

@eddumelendez eddumelendez left a 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.

skagedal and others added 4 commits February 7, 2023 06:35
…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>
@eddumelendez eddumelendez merged commit f8fd492 into docker-java:master Feb 7, 2023
@eddumelendez
Copy link
Member

Thanks for your contribution, @skagedal ! This is now merged in master branch and it will be part of the next release.

@albers
Copy link
Contributor

albers commented Feb 9, 2023

@eddumelendez I think #1946 can be closed now.

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