testcontainers-go
testcontainers-go copied to clipboard
How to control user account that launches images.
We are seeing test containers throttled by dockerhub while downloading images. We have a docker hub pro account. Hence we were not expecting to get throttled by the docker hub.
Which user does the test containers launch the dockers with? Is it possible to change it?
Thanks, Naveen
I had a look at the code and I noticed this https://github.com/testcontainers/testcontainers-go/blob/0d6a586707591c2d74b0e81f3d16a0f3777357d8/container.go#L86
I have to admit I do not remember how it should be used 😕
I had a look around and it looks like this is how credentials should be encoded:
auth := types.AuthConfig{
Username: cfg.User,
Password: cfg.Passwd,
}
authBytes, _ := json.Marshal(auth)
authBase64 := base64.URLEncoding.EncodeToString(authBytes)
https://stackoverflow.com/a/42590443/1894196
@naveenchlsn does https://github.com/testcontainers/testcontainers-go/issues/324#issuecomment-849426711 resolve your use case?
@naveenchlsn I'm closing this issue as there is an open PR (#869) that provides a way to access the docker registry using the credential helpers.
Please reopen it if you do not see it resolved, thanks in advance for your support!