millions-petabyte-47485
11/02/2024, 11:17 PMdocker pull
works just fine as I have already l ran docker login
with my github token.
• I have a separate stack that does the building of the image and pushing to ghcr and have no issues doing this with docker-build.image
• works just fine if I make the image public on ghcr
I followed this helpful tutorial on Abstraction and Encapsulation to build my own docker image component which does different things based on the stack it's ran in.
This is code I am using from my prod stack where I just want to use a remote image ( vs building and deploying to ghcr )
def use_remote_image(self) -> docker.RemoteImage:
registry_image = docker.get_registry_image(name=self.image_tag)
return docker.RemoteImage(
self.docker_build_image_config.get("resource_name"),
name=registry_image.name,
keep_locally=True,
pull_triggers=[registry_image.sha256_digest],
)
The error I get is Got bad response from registry: 401 Unauthorized
Any idea on how I can pass in my credentials to RemoteImage? Couldn't figure out which arg to use.millions-petabyte-47485
11/02/2024, 11:19 PMfetch = True
but for some reason it was not pulling the image it was just building it and exporting locallylittle-cartoon-10569
11/03/2024, 7:39 PMregistryAuth
property contains the creds. I presume the default Docker provider allows these to be assigned, but I don't know for sure.
Out of curiosity: could you get away with a well-known image name and tag? Since most consumers of Docker images only need that information, you might not need a RemoteImage at all.