Skip to content

linux/arm64 Docker image contains x86-64 binary #6

Description

@anschmieg

Summary

The published linux/arm64 GHCR image for ghcr.io/yatesdr/go-llm-proxy:latest appears to contain an x86-64 binary at /usr/local/bin/go-llm-proxy.

On a native Linux ARM64 host, this causes the container to fail immediately with:

exec /usr/local/bin/go-llm-proxy: exec format error

Reproduction

On a Linux ARM64 host:

uname -m
# aarch64

docker info --format 'Docker server: {{.OSType}}/{{.Architecture}}'
# Docker server: linux/aarch64

docker pull ghcr.io/yatesdr/go-llm-proxy:latest

docker image inspect ghcr.io/yatesdr/go-llm-proxy:latest \
  --format 'local image: {{.Os}}/{{.Architecture}} {{.Id}} {{json .RepoDigests}}'
# local image: linux/arm64 sha256:60ec75bddc1b9e27c729383b81c03db570bf13af371494ae02f342eb839eb3cf ["ghcr.io/yatesdr/go-llm-proxy@sha256:ff828f14caacc10ed3463c8785b668e95c5c9ee7172a721c162169c32d7424d3"]

docker run --rm ghcr.io/yatesdr/go-llm-proxy:latest
# exec /usr/local/bin/go-llm-proxy: exec format error

Inspecting the binary inside the image:

docker create --name llm-proxy-inspect ghcr.io/yatesdr/go-llm-proxy:latest
docker cp llm-proxy-inspect:/usr/local/bin/go-llm-proxy /tmp/go-llm-proxy
docker rm llm-proxy-inspect
file /tmp/go-llm-proxy

Actual result:

/tmp/go-llm-proxy: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped

Expected result for the linux/arm64 image:

ELF 64-bit LSB executable, ARM aarch64

Notes

Docker Desktop on Apple Silicon may mask this problem by running the x86-64 binary via emulation. Native Linux ARM64 hosts without amd64 emulation fail immediately.

I opened a small PR that removes the default amd64 value from ARG TARGETARCH so Docker Buildx's automatic target architecture can be used for multi-platform builds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions