Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add workaround for non-static ctr binary in docker 20.10.8 #323

Merged
merged 1 commit into from
Aug 4, 2021

Conversation

thaJeztah
Copy link
Contributor

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

WIP: test docker 20.10.8 (from staging)

Update the Dockerfile with Docker 20.10.8, which is currently on download-stage.docker.com

@thaJeztah
Copy link
Contributor Author

@tianon PTAL. It's probably a bit of a dirty workaround 🙈 🙈 🙈 , but it "works", and unblocks us until containerd/containerd#5824 is resolved somehow

@AkihiroSuda
Copy link
Contributor

SGTM

@thaJeztah thaJeztah changed the title WIP: update to docker 20.10.8, and add workaround for non-static ctr binary update to docker 20.10.8, and add workaround for non-static ctr binary Aug 4, 2021
@thaJeztah
Copy link
Contributor Author

Packages are up on download.docker.com, so updated the URLs; this should be ready for review @tianon

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]>
@tianon
Copy link
Member

tianon commented Aug 4, 2021

I wonder if this (separately, not a blocker) warrants adding something that invokes ctr to our tests. 🤔

@thaJeztah thaJeztah changed the title update to docker 20.10.8, and add workaround for non-static ctr binary add workaround for non-static ctr binary in docker 20.10.8 Aug 4, 2021
Copy link
Member

@tianon tianon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK for a temporary fix, thanks 😄

@@ -2,6 +2,10 @@ FROM alpine:{{ .alpine }}

RUN apk add --no-cache \
ca-certificates \
{{ if ["19.03", "19.03-rc", "20.10-rc"] | index(env.version) | not then ( -}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor nit that this should probably be env.version == "20.10", but it's harmless and the same either way, and hopefully temporary 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh! wrote this based on the existing example I found. didn't try other options, but yes, makes sense.

@tianon tianon merged commit 0e65005 into docker-library:master Aug 4, 2021
docker-library-bot added a commit to docker-library-bot/official-images that referenced this pull request Aug 4, 2021
Changes:

- docker-library/docker@0e65005: Merge pull request docker-library/docker#323 from thaJeztah/docker_20.10.8
- docker-library/docker@75e26ed: Add libc6-compat as workaround for non-static ctr binary
- docker-library/docker@83e4de3: Update 20.10 to 20.10.8
@thaJeztah thaJeztah deleted the docker_20.10.8 branch August 4, 2021 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants