Skip to content

Fix support TLS configuration from docker context #2130

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 2 commits into from
Jul 6, 2023
Merged

Fix support TLS configuration from docker context #2130

merged 2 commits into from
Jul 6, 2023

Conversation

piotrwielgolaski-tomtom
Copy link
Contributor

initial implementation was done based on docker documentation of output of CLI, which is different that real files stored by docker

initial implementation was done based on docker documentation of output of CLI,
which is different that real files stored by docker
@piotrwielgolaski-tomtom piotrwielgolaski-tomtom requested a review from a team as a code owner June 8, 2023 19:11
@piotrwielgolaski-tomtom
Copy link
Contributor Author

This is fixed for my PR #2105

@piotrwielgolaski-tomtom
Copy link
Contributor Author

piotrwielgolaski-tomtom commented Jun 8, 2023

It is connected to my other PR in testcontainers testcontainers/testcontainers-java#7178

@piotrwielgolaski-tomtom
Copy link
Contributor Author

@eddumelendez I noticed that my initial implementation was wrong as I based it on documentation from docker cli not looking at real files on filesystem, this time I did full check and make it work with test container, so it should be fine to merge this and connected PR in testcontainers

@eddumelendez
Copy link
Member

Can you please share links to the documentation, etc as part of the PR description?

@piotrwielgolaski-tomtom
Copy link
Contributor Author

here is link to documentations https://github.com/docker/cli/blob/a0756c3c2cacebf5e5dc6454cc280c3ddf675176/docs/reference/commandline/context_inspect.md?plain=1#L42
but it is stored in filesystem in different way

@piotrwielgolaski-tomtom
Copy link
Contributor Author

@eddumelendez
Copy link
Member

I think a need a clear description. Those links are not helping. Thanks

@piotrwielgolaski-tomtom
Copy link
Contributor Author

piotrwielgolaski-tomtom commented Jun 30, 2023

I don't know what kind of description you have in mind but let me summarised what happen.

Initial support for docker context was lacking support for TLS, so it was not working in case you want to use docker remote with TLS - this was initial support #2036

In attempt to extend it I created PR #2105, but I assumed that was is described as output of docker context inspect is in fact in files on disk.
I assumed that Storage section exists in file, but after you merged it and I tried to use it I noticed that in fact this information is only gather in runtime by docker cli which can be track to https://github.com/docker/cli/blob/33c7baa7edf962559a07c1fb59581f863a7e8862/cli/context/store/store.go#L26

In my next attempt (this PR) I dig dipper what in fact is stored in ~/.docker/contexts and there are two folders for metadata and for tls.

ls -1 ~/.docker/contexts
meta
tls

This PR is relying on folder structure to pick up TLS information and provide them to docker-java when context is used.

I hope it is enough, but if not, let me know what more I can do to make this merged

@eddumelendez
Copy link
Member

Thanks! Indeed, it helps. I wanted to clarify this before to continue.

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.

@eddumelendez eddumelendez added this to the next milestone Jul 6, 2023
@eddumelendez eddumelendez merged commit 95f65e2 into docker-java:main Jul 6, 2023
@eddumelendez
Copy link
Member

Thanks for your contribution, @piotrwielgolaski-tomtom !

@piotrwielgolaski-tomtom piotrwielgolaski-tomtom deleted the faeture/tls_settings_from_context branch July 8, 2023 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants