Skip to content

Commit 75e26ed

Browse files
committed
Add libc6-compat as workaround for non-static ctr binary
When compiling containerd's ctr on Go 1.15 or up, the produced binary is not fully static, causing it to fail on Alpine: ldd /usr/local/bin/ctr /lib64/ld-linux-x86-64.so.2 (0x7f1970417000) This issue is tracked in containerd/containerd#5824. Until it's fixed, adding `libc6-compat` as a workaround: https://pkgs.alpinelinux.org/package/edge/main/x86_64/libc6-compat Note that there's an alternative `gcompat` package, which provides similar functionality (and also resolves the issue), but unlike `libc6-compat`, that package is a `community` package, is larger, and has more dependencies: https://pkgs.alpinelinux.org/package/edge/community/x86_64/gcompat Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 83e4de3 commit 75e26ed

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

20.10/Dockerfile

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile.template

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ FROM alpine:{{ .alpine }}
22

33
RUN apk add --no-cache \
44
ca-certificates \
5+
{{ if ["19.03", "19.03-rc", "20.10-rc"] | index(env.version) | not then ( -}}
6+
# Workaround for golang not producing a static ctr binary on Go 1.15 and up https://github.com/containerd/containerd/issues/5824
7+
libc6-compat \
8+
{{ ) else "" end -}}
59
# DOCKER_HOST=ssh://... -- https://github.com/docker/cli/pull/1014
610
openssh-client
711

0 commit comments

Comments
 (0)