Closed jf647 closed 3 years ago
Hi @jf647, thanks for the report. I'll take a look in the next few days. Your research and recommendations will certainly help😼
@jf647, I got to it a bit earlier than I thought. Can you give #190 a try before I merge it?
Describe the bug
I am trying to bring up a custom container using gnomock.StartContainer(). The image is hosted on Google Container Registry (gcr.io), which requires authentication.
The container fails to start with the error:
docker pull
for the same image works just fine however:To Reproduce
Expected behavior
If
docker pull
works for a given image, gnomock should also be able to start that image.System (please complete the following information):
Additional context
The root cause is likely that Gnomock passes a fixed, empty set of pull options to the Docker client. If there were an way to pass ImagePullOptions to .StartCustom, then I could probably get around this by base64 encoding the required config.
Ideally, it would be nice if the docker client just used my
~/docker/config.json
and "did the right thing", but that doesn't seem to be part of the docker client package. Another option would be to allow the HTTP client to be passed via a Gnomock option, but that's just asking the user to manage the crafting of theX-Registry-Auth
header (which is what passing an ImagePullOptions struct with a populated RegistryAuth does for you.)