Automating the pull from a private repository

Hi,

I’m trying to automate the pull of containers at build time from a private repo, so it needs authentication.
What would be the best way to put the authentication in the build script, I’m not keen on writing my username/password there.

Thanks,
Isaac

Take a look at this: https://docs.docker.com/registry/spec/auth/token/

There are some fairly recent new methods which can be used to authenticate with registries IIRC

thanks! that seems to be what I was looking for :slight_smile:

Do you have a bit more info on how to use the token once it’s created?
I think I got it created correctly, now I’m trying to use it by adding the following to the docker config:
“HttpHeaders”: {
“X-Registry-Auth”: “token-string”
}

But it’s hard to know if the token is wrong or the config file is wrong. As I don’t get any auth error.
I’m getting an image not found error, same as when I’m logged out.

Thanks,
Isaac