Closed dubo-dubon-duponey closed 3 years ago
Upstream knows about this... https://github.com/gliderlabs/logspout/issues/340
Also would really like to see this arm support.
Closing. Multi-arch support has been added in this PR
Edit: @cederberg addresses all my concerns in this post with his reply below. tl;dr the /bin/logspout
binary inside the image is correct and you can ignore the warnings
Yes, the image for linux/arm64/v8
contains incorrect meta-data that suggests it is linux/amd64
. The Docker manifest XML for logdna/logspout:latest
is however tagged correctly:
$> docker manifest inspect logdna/logspout:latest
{
"schemaVersion": 2,
"mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
"manifests": [
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 738,
"digest": "sha256:a52e4887fa672cc7b6c76ca24f650cc69d04f1bbd207a95a2dc45f4d5e77a6e2",
"platform": {
"architecture": "amd64",
"os": "linux"
}
},
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 738,
"digest": "sha256:39955efa29212d88652597773671d59f04169af7761ab2ddf44b676a9a560501",
"platform": {
"architecture": "arm64",
"os": "linux"
}
}
]
}
Why is this so, you might ask? Well, it is caused by the Docker build tools setting image metadata to the architecture where the image is built. And it cannot easily be changed afterwards (AFAIK).
But Logspout is written in Go, which can easily be cross-compiled to other architectures by setting GOARCH
, GOOS
and so on. So, in spite of the warnings, the static binary is actually compiled for the right architecture. You can inspect the binary with a tool like file
or similar to verify this.
Once Docker gets their cross-compilation act together, this will probably go away. But currently the only way to get proper metadata into images that I know of is to use the docker buildx
tools (BuildKit) which until recently (still?) were marked experimental.
Hey there.
Would be nice to get a proper multi-architecture image for this.
Nowadays, you may use buildx for that, which makes it fairly trivial.
CircleCI probably doesn't support the appropriate docker version for that though.