Open koliyo opened 2 weeks ago
Hi @koliyo, thanks for raising this issue. We already explain in https://golang.testcontainers.org/features/docker_auth/ the different mechanisms to discover the Docker auth, but I'm not against adding custom examples for how to achieve what you did.
Do you mind submitting a PR to the docs site, to that page? I could imagine adding it at the end of the page with something like this:
## Docker Auth examples
### Creating a custom Docker config file
(...your code snippet...)
I think the matter of being GHCR or any other site it's an implementation detail, so I'd not create a dedicated entry for GHCR, but use it as the code snippet for a general way for building the auth config file.
Wdyt?
Proposal
I was struggling with login in to our github container registry because the
ghcr.io/atc0005/go-ci
image does not have the docker binary. I did however find a working solution, by handcrafting a.docker/config.json
as mentioned here: https://golang.testcontainers.org/features/docker_auth/But having explicit instructions how to actually do it for github actions would be very helpful. So I suggest adding the following setup as an example in a github action workflow:
This will work with testcontainers even if the host container does not contain the docker binary.