Fixes for arm

This commit is contained in:
David Boreham 2024-02-27 08:49:32 -07:00
parent 1663881f94
commit 61dda7f6d9

View File

@ -84,13 +84,14 @@ def _filter_for_platform(container: str,
tag_list: List[str]) -> List[str] :
filtered_tags = []
this_machine = platform.machine()
# Translate between Python platform names and docker
# Translate between Python and docker platform names
if this_machine == "x86_64":
this_machine = "amd64"
if this_machine == "aarch64":
this_machine = "arm64"
if opts.o.debug:
print(f"Python says the architecture is: {this_machine}")
docker = DockerClient()
docker.login(registry_info.registry, registry_info.registry_username, registry_info.registry_token)
for tag in tag_list:
remote_tag = f"{registry_info.registry}/{container}:{tag}"
manifest_cmd = ExtendedManifestCLI(docker.client_config)
@ -119,7 +120,6 @@ def _get_latest_image(container: str, registry_info: RegistryInfo):
def _fetch_image(tag: str, registry_info: RegistryInfo):
docker = DockerClient()
docker.login(registry_info.registry, registry_info.registry_username, registry_info.registry_token)
remote_tag = f"{registry_info.registry}/{tag}"
if opts.o.debug:
print(f"Attempting to pull this image: {remote_tag}")
@ -148,6 +148,8 @@ def command(ctx, include, exclude, force_local_overwrite, image_registry, regist
'''EXPERIMENTAL: fetch the images for a stack from remote registry'''
registry_info = RegistryInfo(image_registry, registry_username, registry_token)
docker = DockerClient()
docker.login(registry_info.registry, registry_info.registry_username, registry_info.registry_token)
# Generate list of target containers
stack = ctx.obj.stack
containers_in_scope = get_containers_in_scope(stack)
@ -161,7 +163,7 @@ def command(ctx, include, exclude, force_local_overwrite, image_registry, regist
# images with the correct name and platform in the specified registry
image_to_fetch = _get_latest_image(container, registry_info)
if not image_to_fetch:
print(f"Warning: no image found to fetch for container {container}")
print(f"Warning: no image found to fetch for container: {container}")
all_containers_found = False
continue
if opts.o.debug: