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

Revert "Dockerfile: update containerd binary to v2.0.0" #5546

Closed
wants to merge 1 commit into from

Conversation

tonistiigi
Copy link
Member

This reverts commit b1adeed.

Building for arm64 fails.

 docker buildx build --target containerd --platform linux/arm64 .

=> ERROR [containerd 3/3] RUN /build.sh                                                                                                  12.9s
------
 > [containerd 3/3] RUN /build.sh:
0.096 + mkdir /out
0.097 + xx-info os
0.099 + '[' linux '=' linux ]
0.099 + make bin/containerd
0.649 + bin/containerd
0.649 go build  -gcflags=-trimpath=/go/src -buildmode=pie  -o bin/containerd -ldflags '-X github.com/containerd/containerd/v2/version.Version=v2.0.0 -X github.com/containerd/containerd/v2/version.Revision=207ad711eabd375a01713109a8a197d197ff6542 -X github.com/containerd/containerd/v2/version.Package=github.com/containerd/containerd/v2 -s -w ' -tags "no_btrfs urfave_cli_no_docs"  ./cmd/containerd
12.74 # github.com/containerd/containerd/cmd/containerd
12.74 /usr/local/go/pkg/tool/linux_arm64/link: running aarch64-alpine-linux-musl-clang failed: exit status 1
12.74 /usr/bin/aarch64-alpine-linux-musl-clang -s -Wl,-z,relro -pie -Wl,-z,now -Wl,-z,nocopyreloc -fuse-ld=gold -o $WORK/b001/exe/a.out -rdynamic /tmp/go-link-585608912/go.o /tmp/go-link-585608912/000000.o /tmp/go-link-585608912/000001.o /tmp/go-link-585608912/000002.o /tmp/go-link-585608912/000003.o /tmp/go-link-585608912/000004.o /tmp/go-link-585608912/000005.o /tmp/go-link-585608912/000006.o /tmp/go-link-585608912/000007.o /tmp/go-link-585608912/000008.o /tmp/go-link-585608912/000009.o /tmp/go-link-585608912/000010.o /tmp/go-link-585608912/000011.o /tmp/go-link-585608912/000012.o /tmp/go-link-585608912/000013.o /tmp/go-link-585608912/000014.o /tmp/go-link-585608912/000015.o /tmp/go-link-585608912/000016.o /tmp/go-link-585608912/000017.o /tmp/go-link-585608912/000018.o /tmp/go-link-585608912/000019.o /tmp/go-link-585608912/000020.o /tmp/go-link-585608912/000021.o /tmp/go-link-585608912/000022.o /tmp/go-link-585608912/000023.o /tmp/go-link-585608912/000024.o /tmp/go-link-585608912/000025.o /tmp/go-link-585608912/000026.o /tmp/go-link-585608912/000027.o /tmp/go-link-585608912/000028.o -O2 -g -lresolv -O2 -g -lpthread -O2 -g -ldl -O2 -g -O2 -g -ldl
12.74 clang: error: invalid linker name in argument '-fuse-ld=gold'
12.74
12.82 make: *** [Makefile:264: bin/containerd] Error 1
------
Dockerfile:234
--------------------
 232 |     ARG CONTAINERD_VERSION
 233 |     ADD --keep-git-dir=true "https://github.com/containerd/containerd.git#$CONTAINERD_VERSION" .
 234 | >>> RUN /build.sh
 235 |
 236 |     # containerd-alt-17 builds containerd v1.7 for integration tests
--------------------

--platform=linux/amd64 is ok and this is why CI is ok. We might need to make sure that integration tests stage is tested on arm64 as well (even if tests actually don't run this way).

@AkihiroSuda If you can provide immediate fix then this can be closed. Otherwise revert and then reenable later.

@crazy-max
Copy link
Member

We might need to make sure that integration tests stage is tested on arm64 as well (even if tests actually don't run this way).

I think we could if we have self-hosted runners on arm64 but don't think we have any atm.

@tonistiigi
Copy link
Member Author

I think we could if we have self-hosted runners on arm64 but don't think we have any atm.

For this specific issue, I think just cross-compiling the stage would have done it.

@thaJeztah
Copy link
Member

@tonistiigi see this PR as well in containerd packaging; it has some links as well;

@crazy-max
Copy link
Member

I think we could if we have self-hosted runners on arm64 but don't think we have any atm.

For this specific issue, I think just cross-compiling the stage would have done it.

Oh right we don't release containerd bin. We could cross-comp indeed.

@AkihiroSuda
Copy link
Member

Tried:

diff --git a/Dockerfile b/Dockerfile
index 576c5e368..cef01dd7c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -204,7 +204,7 @@ FROM gobuild-base AS containerd-build
 WORKDIR /go/src/github.com/containerd/containerd
 ARG TARGETPLATFORM
 ENV CGO_ENABLED=1 BUILDTAGS=no_btrfs GO111MODULE=off
-RUN xx-apk add musl-dev gcc && xx-go --wrap
+RUN xx-apk add musl-dev gcc binutils-gold && xx-go --wrap
 COPY --chmod=755 <<-EOT /build.sh
 #!/bin/sh
 set -ex

No success 😞

1.150 go build  -gcflags=-trimpath=/go/src -buildmode=pie  -o bin/containerd -ldflags '-X github.com/containerd/containerd/v2/version.Version=v2.0.0 -X github.com/containerd/containerd/v2/version.Revision=207ad711eabd375a01713109a8a197d197ff6542 -X github.com/containerd/containerd/v2/version.Package=github.com/containerd/containerd/v2 -s -w ' -tags "no_btrfs urfave_cli_no_docs"  ./cmd/containerd
74.13 # github.com/containerd/containerd/cmd/containerd
74.13 /usr/local/go/pkg/tool/linux_amd64/link: running aarch64-alpine-linux-musl-clang failed: exit status 1
74.13 /usr/bin/aarch64-alpine-linux-musl-clang -s -Wl,-z,relro -pie -Wl,-z,now -Wl,-z,nocopyreloc -fuse-ld=gold -o $WORK/b001/exe/a.out -rdynamic /tmp/go-link-1651506463/go.o /tmp/go-link-1651506463/000000.o /tmp/go-link-1651506463/000001.o /tmp/go-link-1651506463/000002.o /tmp/go-link-1651506463/000003.o /tmp/go-link-1651506463/000004.o /tmp/go-link-1651506463/000005.o /tmp/go-link-1651506463/000006.o /tmp/go-link-1651506463/000007.o /tmp/go-link-1651506463/000008.o /tmp/go-link-1651506463/000009.o /tmp/go-link-1651506463/000010.o /tmp/go-link-1651506463/000011.o /tmp/go-link-1651506463/000012.o /tmp/go-link-1651506463/000013.o /tmp/go-link-1651506463/000014.o /tmp/go-link-1651506463/000015.o /tmp/go-link-1651506463/000016.o /tmp/go-link-1651506463/000017.o /tmp/go-link-1651506463/000018.o /tmp/go-link-1651506463/000019.o /tmp/go-link-1651506463/000020.o /tmp/go-link-1651506463/000021.o /tmp/go-link-1651506463/000022.o /tmp/go-link-1651506463/000023.o /tmp/go-link-1651506463/000024.o /tmp/go-link-1651506463/000025.o /tmp/go-link-1651506463/000026.o /tmp/go-link-1651506463/000027.o /tmp/go-link-1651506463/000028.o -O2 -g -lresolv -O2 -g -lpthread -O2 -g -ldl -O2 -g -O2 -g -ldl
74.13 clang: error: unable to execute command: posix_spawn failed: Exec format error
74.13 clang: error: linker command failed with exit code 1 (use -v to see invocation)
74.13 
74.37 make: *** [Makefile:264: bin/containerd] Error 1

@tonistiigi
Copy link
Member Author

@AkihiroSuda You wouldn't use xx-apk to install linker as it is a binary, not a library. But I think it would be important to understand what exactly broke in here. Is it related to go1.23 update (although 1.7 seems to build fine with 1.23)? Our preferred linker for clang would be lld .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants