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

docker-credential-helpers fails to build from source on Centos 7.9 #260

Closed
vkimura opened this issue Mar 21, 2023 · 4 comments · Fixed by #286
Closed

docker-credential-helpers fails to build from source on Centos 7.9 #260

vkimura opened this issue Mar 21, 2023 · 4 comments · Fixed by #286

Comments

@vkimura
Copy link

vkimura commented Mar 21, 2023

Replicate fail on Centos 7.9:

$ git clone https://github.com/docker/docker-credential-helpers.git
$ cd docker-credential-helpers
$ docker buildx bake
`
[+] Building 138.0s (35/43)
 => [internal] booting buildkit                                                                                                                                                           8.2s
 => => pulling image moby/buildkit:buildx-stable-1                                                                                                                                        4.8s
 => => creating container buildx_buildkit_amazing_euler0                                                                                                                                  3.4s
 => CACHED [internal] load git source https://github.com/docker/docker-credential-helpers.git                                                                                             2.2s
 => resolve image config for docker.io/docker/dockerfile:1                                                                                                                                0.7s
 => docker-image://docker.io/docker/dockerfile:1@sha256:39b85bbfa7536a5feceb7372a0817649ecb2724562a38360f4d6a7782a409b14                                                                  0.5s
 => => resolve docker.io/docker/dockerfile:1@sha256:39b85bbfa7536a5feceb7372a0817649ecb2724562a38360f4d6a7782a409b14                                                                      0.0s
 => => sha256:a47ff7046597eea0123ea02817165350e3680f75000dc5d69c9a310258e1bedd 11.55MB / 11.55MB                                                                                          0.4s
 => => extracting sha256:a47ff7046597eea0123ea02817165350e3680f75000dc5d69c9a310258e1bedd                                                                                                 0.2s
 => [linux/amd64 internal] load metadata for docker.io/library/golang:1.18.5-bullseye                                                                                                     1.1s
 => [linux/amd64 internal] load metadata for docker.io/tonistiigi/xx:1.1.2                                                                                                                1.1s
 => [darwin/amd64 internal] load metadata for docker.io/crazymax/osxcross:11.3-r7-debian                                                                                                  1.3s
 => [darwin/arm64 internal] load metadata for docker.io/crazymax/osxcross:11.3-r7-debian                                                                                                  1.2s
 => [darwin/amd64 osxcross 1/1] FROM docker.io/crazymax/osxcross:11.3-r7-debian@sha256:d7cb4d9aa8108f5a93cfe6be371a049ffeea5a3871586d309106a27bd295bf60                                  16.7s
 => => resolve docker.io/crazymax/osxcross:11.3-r7-debian@sha256:d7cb4d9aa8108f5a93cfe6be371a049ffeea5a3871586d309106a27bd295bf60                                                         0.0s
 => => sha256:97a50541409e59fe1d9a410a80983637140e940e09e2d6bcb5624e7c83336a35 85.17MB / 85.17MB                                                                                          1.9s
 => => extracting sha256:97a50541409e59fe1d9a410a80983637140e940e09e2d6bcb5624e7c83336a35                                                                                                14.8s
 => [linux/amd64 xx 1/1] FROM docker.io/tonistiigi/xx:1.1.2@sha256:9dde7edeb9e4a957ce78be9f8c0fbabe0129bf5126933cd3574888f443731cda                                                       0.2s
 => => resolve docker.io/tonistiigi/xx:1.1.2@sha256:9dde7edeb9e4a957ce78be9f8c0fbabe0129bf5126933cd3574888f443731cda                                                                      0.0s
 => => sha256:6b9f00cd577380cfa5d5a8d5ebf82f91f7aa469401818e4de53b2a16dd4a1642 14.97kB / 14.97kB                                                                                          0.1s
 => => extracting sha256:6b9f00cd577380cfa5d5a8d5ebf82f91f7aa469401818e4de53b2a16dd4a1642                                                                                                 0.0s
 => [linux/amd64 gobase 1/4] FROM docker.io/library/golang:1.18.5-bullseye@sha256:c362804a0f4e21a7006e36212cbcec6b2888c01dd560d577e74e33d32e12013f                                       20.4s
 => => resolve docker.io/library/golang:1.18.5-bullseye@sha256:c362804a0f4e21a7006e36212cbcec6b2888c01dd560d577e74e33d32e12013f                                                           0.0s
 => => sha256:17ab5c0fa3a1c58ccead4c99021181e5ac31a2116e91ee16616a3c6267c9e223 156B / 156B                                                                                                0.1s
 => => sha256:dacb042d4b557bba852cbd15b9e3251e6b11f0b755b89541540c1894b7c4ef2c 85.91MB / 85.91MB                                                                                          2.8s
 => => sha256:1b8b7b0817d4ac31fa078cb93a3934e446c9c6c143dc801d5a5e52d40e0ac58e 141.86MB / 141.86MB                                                                                        4.1s
 => => sha256:53ad072f9cd16fc8eb93b182b20e758e11acc0ef60babef0bf1043c08de1901a 54.58MB / 54.58MB                                                                                          2.3s
 => => sha256:fa9c7528c685216129e8e67bf362a7702e7b1daa585ab85546a41508830657d6 10.88MB / 10.88MB                                                                                          0.5s
 => => sha256:1671565cc8df8c365c9b661d3fbc164e73d01f1b0430c6179588428f99a9da2e 55.01MB / 55.01MB                                                                                          1.2s
 => => sha256:3e94d13e55e7a4ef17ff21376f57fb95c7e1706931f8704aa99260968d81f6e4 5.16MB / 5.16MB                                                                                            0.4s
 => => extracting sha256:1671565cc8df8c365c9b661d3fbc164e73d01f1b0430c6179588428f99a9da2e                                                                                                 2.6s
 => => extracting sha256:3e94d13e55e7a4ef17ff21376f57fb95c7e1706931f8704aa99260968d81f6e4                                                                                                 0.3s
 => => extracting sha256:fa9c7528c685216129e8e67bf362a7702e7b1daa585ab85546a41508830657d6                                                                                                 0.3s
 => => extracting sha256:53ad072f9cd16fc8eb93b182b20e758e11acc0ef60babef0bf1043c08de1901a                                                                                                 2.9s
 => => extracting sha256:dacb042d4b557bba852cbd15b9e3251e6b11f0b755b89541540c1894b7c4ef2c                                                                                                 3.2s
 => => extracting sha256:1b8b7b0817d4ac31fa078cb93a3934e446c9c6c143dc801d5a5e52d40e0ac58e                                                                                                 7.3s
 => => extracting sha256:17ab5c0fa3a1c58ccead4c99021181e5ac31a2116e91ee16616a3c6267c9e223                                                                                                 0.0s
 => [darwin/arm64 osxcross 1/1] FROM docker.io/crazymax/osxcross:11.3-r7-debian@sha256:d7cb4d9aa8108f5a93cfe6be371a049ffeea5a3871586d309106a27bd295bf60                                   0.0s
 => => resolve docker.io/crazymax/osxcross:11.3-r7-debian@sha256:d7cb4d9aa8108f5a93cfe6be371a049ffeea5a3871586d309106a27bd295bf60                                                         0.0s
 => [linux/amd64 gobase 2/4] COPY --from=xx / /                                                                                                                                           2.2s
 => [linux/amd64 gobase 3/4] RUN apt-get update && apt-get install -y --no-install-recommends clang dpkg-dev file git lld llvm make pkg-config rsync                                     21.0s
 => [linux/amd64 gobase 4/4] WORKDIR /src                                                                                                                                                 0.2s
 => CANCELED [linux/amd64->ppc64le base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                   79.8s
 => [linux/amd64->arm/v7 base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                             70.2s
 => [linux/amd64->windows/amd64 base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                      35.4s
 => CANCELED [linux/amd64->arm/v6 base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                    80.0s
 => [linux/amd64->darwin/arm64 base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                        9.8s
 => [linux/amd64->darwin/amd64 base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                        9.0s
 => [linux/amd64 version 1/1] RUN --mount=target=.     echo -n "$(./hack/git-meta version)" | tee /tmp/.version ; echo -n "$(./hack/git-meta revision)" | tee /tmp/.revision              0.6s
 => CANCELED [linux/amd64->arm64 base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                     80.4s
 => [linux/amd64->s390x base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                              78.7s
 => [linux/amd64 base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                                      8.0s
 => [linux/amd64 build-linux 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,source=/tmp  16.6s
 => [linux/amd64->darwin/amd64 build-darwin 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=b  33.3s
 => [linux/amd64->darwin/arm64 build-darwin 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=b  45.6s
 => [linux/amd64 binaries 1/1] COPY --from=build /out /                                                                                                                                   0.0s
 => [linux/amd64->windows/amd64 build-windows 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type  10.0s
 => [darwin/amd64 binaries 1/1] COPY --from=build /out /                                                                                                                                  0.0s
 => [windows/amd64 binaries 1/1] COPY --from=build /out /                                                                                                                                 0.0s
 => [darwin/arm64 binaries 1/1] COPY --from=build /out /                                                                                                                                  0.1s
 => ERROR [linux/amd64->arm/v7 build-linux 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bin  8.9s
 => CANCELED [linux/amd64->s390x build-linux 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=b  1.5s
------
 > [linux/amd64->arm/v7 build-linux 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,source=/tmp/.version,target=/tmp/.version,from=version     --mount=type=bind,source=/tmp/.revision,target=/tmp/.revision,from=version <<EOT (set -ex...):
#0 0.234 + xx-go --wrap
#0 0.295 + cat /tmp/.version
#0 0.297 + cat /tmp/.revision
#0 0.298 + make build-pass build-secretservice PACKAGE=github.com/docker/docker-credential-helpers VERSION= REVISION=.m DESTDIR=/out
#0 0.301 go build -trimpath -ldflags="-s -w -X github.com/docker/docker-credential-helpers/credentials.Version= -X github.com/docker/docker-credential-helpers/credentials.Revision=.m -X github.com/docker/docker-credential-helpers/credentials.Package=github.com/docker/docker-credential-helpers -X github.com/docker/docker-credential-helpers/credentials.Name=docker-credential-pass" -o "/out/docker-credential-pass" ./pass/cmd/
#0 6.407 go build -trimpath -ldflags="-s -w -X github.com/docker/docker-credential-helpers/credentials.Version= -X github.com/docker/docker-credential-helpers/credentials.Revision=.m -X github.com/docker/docker-credential-helpers/credentials.Package=github.com/docker/docker-credential-helpers -X github.com/docker/docker-credential-helpers/credentials.Name=docker-credential-secretservice" -o "/out/docker-credential-secretservice" ./secretservice/cmd/
#0 8.402 # arm-linux-gnueabihf-pkg-config --cflags  -- libsecret-1
#0 8.402 /usr/bin/arm-linux-gnueabihf-pkg-config: 23: exec: pkg-config: Exec format error
#0 8.402 arm-linux-gnueabihf-pkg-config: exit status 126
#0 8.409 make: *** [Makefile:20: build-secretservice] Error 2
------
Dockerfile:102
--------------------
 101 |     ARG PACKAGE
 102 | >>> RUN --mount=type=bind,target=. \
 103 | >>>     --mount=type=cache,target=/root/.cache \
 104 | >>>     --mount=type=cache,target=/go/pkg/mod \
 105 | >>>     --mount=type=bind,source=/tmp/.version,target=/tmp/.version,from=version \
 106 | >>>     --mount=type=bind,source=/tmp/.revision,target=/tmp/.revision,from=version <<EOT
 107 | >>>   set -ex
 108 | >>>   xx-go --wrap
 109 | >>>   make build-pass build-secretservice PACKAGE=$PACKAGE VERSION=$(cat /tmp/.version) REVISION=$(cat /tmp/.revision) DESTDIR=/out
 110 | >>>   xx-verify /out/docker-credential-pass
 111 | >>>   xx-verify /out/docker-credential-secretservice
 112 | >>> EOT
 113 |
--------------------
ERROR: failed to solve: process "/bin/sh -c   set -ex\n  xx-go --wrap\n  make build-pass build-secretservice PACKAGE=$PACKAGE VERSION=$(cat /tmp/.version) REVISION=$(cat /tmp/.revision) DESTDIR=/out\n  xx-verify /out/docker-credential-pass\n  xx-verify /out/docker-credential-secretservice\n" did not complete successfully: exit code: 2
[sshuser@host ~]$ git clone https://github.com/docker/docker-credential-helpers.git
Cloning into 'docker-credential-helpers'...
remote: Enumerating objects: 1227, done.
remote: Counting objects: 100% (355/355), done.
remote: Compressing objects: 100% (237/237), done.
remote: Total 1227 (delta 142), reused 274 (delta 85), pack-reused 872
Receiving objects: 100% (1227/1227), 511.04 KiB | 6.23 MiB/s, done.
Resolving deltas: 100% (639/639), done.
[sshuser@host ~]$ cd docker-credential-helpers
[sshuser@host docker-credential-helpers]$ docker buildx bake
[+] Building 5.1s (32/44)
 => [internal] load build definition from Dockerfile                                                                                                                                      0.0s
 => => transferring dockerfile: 5.78kB                                                                                                                                                    0.0s
 => [internal] load .dockerignore                                                                                                                                                         0.0s
 => => transferring context: 45B                                                                                                                                                          0.0s
 => resolve image config for docker.io/docker/dockerfile:1                                                                                                                                0.2s
 => CACHED docker-image://docker.io/docker/dockerfile:1@sha256:39b85bbfa7536a5feceb7372a0817649ecb2724562a38360f4d6a7782a409b14                                                           0.0s
 => => resolve docker.io/docker/dockerfile:1@sha256:39b85bbfa7536a5feceb7372a0817649ecb2724562a38360f4d6a7782a409b14                                                                      0.0s
 => [linux/amd64 internal] load metadata for docker.io/library/golang:1.18.5-bullseye                                                                                                     0.1s
 => [linux/amd64 internal] load metadata for docker.io/tonistiigi/xx:1.1.2                                                                                                                0.1s
 => [darwin/amd64 internal] load metadata for docker.io/crazymax/osxcross:11.3-r7-debian                                                                                                  0.1s
 => [darwin/arm64 internal] load metadata for docker.io/crazymax/osxcross:11.3-r7-debian                                                                                                  0.1s
 => [internal] load build context                                                                                                                                                         0.1s
 => => transferring context: 2.25MB                                                                                                                                                       0.1s
 => [linux/amd64 gobase 1/4] FROM docker.io/library/golang:1.18.5-bullseye@sha256:c362804a0f4e21a7006e36212cbcec6b2888c01dd560d577e74e33d32e12013f                                        0.0s
 => => resolve docker.io/library/golang:1.18.5-bullseye@sha256:c362804a0f4e21a7006e36212cbcec6b2888c01dd560d577e74e33d32e12013f                                                           0.0s
 => [linux/amd64 xx 1/1] FROM docker.io/tonistiigi/xx:1.1.2@sha256:9dde7edeb9e4a957ce78be9f8c0fbabe0129bf5126933cd3574888f443731cda                                                       0.0s
 => => resolve docker.io/tonistiigi/xx:1.1.2@sha256:9dde7edeb9e4a957ce78be9f8c0fbabe0129bf5126933cd3574888f443731cda                                                                      0.0s
 => CACHED [darwin/arm64 osxcross 1/1] FROM docker.io/crazymax/osxcross:11.3-r7-debian@sha256:d7cb4d9aa8108f5a93cfe6be371a049ffeea5a3871586d309106a27bd295bf60                            0.0s
 => => resolve docker.io/crazymax/osxcross:11.3-r7-debian@sha256:d7cb4d9aa8108f5a93cfe6be371a049ffeea5a3871586d309106a27bd295bf60                                                         0.0s
 => CACHED [darwin/amd64 osxcross 1/1] FROM docker.io/crazymax/osxcross:11.3-r7-debian@sha256:d7cb4d9aa8108f5a93cfe6be371a049ffeea5a3871586d309106a27bd295bf60                            0.0s
 => => resolve docker.io/crazymax/osxcross:11.3-r7-debian@sha256:d7cb4d9aa8108f5a93cfe6be371a049ffeea5a3871586d309106a27bd295bf60                                                         0.0s
 => CACHED [linux/amd64 gobase 2/4] COPY --from=xx / /                                                                                                                                    0.0s
 => CACHED [linux/amd64 gobase 3/4] RUN apt-get update && apt-get install -y --no-install-recommends clang dpkg-dev file git lld llvm make pkg-config rsync                               0.0s
 => CACHED [linux/amd64 gobase 4/4] WORKDIR /src                                                                                                                                          0.0s
 => CACHED [linux/amd64->arm/v7 base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                       0.0s
 => CACHED [linux/amd64->s390x base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                        0.0s
 => CANCELED [linux/amd64->arm/v6 base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                     3.4s
 => CANCELED [linux/amd64->ppc64le base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                    3.6s
 => CANCELED [linux/amd64->arm64 base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                      3.2s
 => CACHED [linux/amd64 base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                               0.0s
 => CACHED [linux/amd64->windows/amd64 base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                0.0s
 => CACHED [linux/amd64->darwin/amd64 base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                 0.0s
 => CACHED [linux/amd64->darwin/arm64 base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                 0.0s
 => [linux/amd64 version 1/1] RUN --mount=target=.     echo -n "$(./hack/git-meta version)" | tee /tmp/.version ; echo -n "$(./hack/git-meta revision)" | tee /tmp/.revision              0.4s
 => CANCELED [linux/amd64->s390x build-linux 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=b  3.5s
 => CANCELED [linux/amd64->darwin/arm64 build-darwin 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --moun  3.3s
 => CANCELED [linux/amd64 build-linux 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,sou  3.7s
 => CANCELED [linux/amd64->darwin/amd64 build-darwin 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --moun  2.4s
 => ERROR [linux/amd64->arm/v7 build-linux 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bin  1.7s
 => [linux/amd64->windows/amd64 build-windows 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=  1.3s
------
 > [linux/amd64->arm/v7 build-linux 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,source=/tmp/.version,target=/tmp/.version,from=version     --mount=type=bind,source=/tmp/.revision,target=/tmp/.revision,from=version <<EOT (set -ex...):
#0 0.237 + xx-go --wrap
#0 0.308 + cat /tmp/.version
#0 0.311 + cat /tmp/.revision
#0 0.313 + make build-pass build-secretservice PACKAGE=github.com/docker/docker-credential-helpers VERSION=v0.7.0-4-gd783511 REVISION=d7835111fd00ef0c2f597b2130384df2c42c2745 DESTDIR=/out
#0 0.316 go build -trimpath -ldflags="-s -w -X github.com/docker/docker-credential-helpers/credentials.Version=v0.7.0-4-gd783511 -X github.com/docker/docker-credential-helpers/credentials.Revision=d7835111fd00ef0c2f597b2130384df2c42c2745 -X github.com/docker/docker-credential-helpers/credentials.Package=github.com/docker/docker-credential-helpers -X github.com/docker/docker-credential-helpers/credentials.Name=docker-credential-pass" -o "/out/docker-credential-pass" ./pass/cmd/
#0 0.819 go build -trimpath -ldflags="-s -w -X github.com/docker/docker-credential-helpers/credentials.Version=v0.7.0-4-gd783511 -X github.com/docker/docker-credential-helpers/credentials.Revision=d7835111fd00ef0c2f597b2130384df2c42c2745 -X github.com/docker/docker-credential-helpers/credentials.Package=github.com/docker/docker-credential-helpers -X github.com/docker/docker-credential-helpers/credentials.Name=docker-credential-secretservice" -o "/out/docker-credential-secretservice" ./secretservice/cmd/
#0 1.143 # arm-linux-gnueabihf-pkg-config --cflags  -- libsecret-1
#0 1.143 /usr/bin/arm-linux-gnueabihf-pkg-config: 23: exec: pkg-config: Exec format error
#0 1.143 arm-linux-gnueabihf-pkg-config: exit status 126
#0 1.149 make: *** [Makefile:20: build-secretservice] Error 2
------
Dockerfile:102
--------------------
 101 |     ARG PACKAGE
 102 | >>> RUN --mount=type=bind,target=. \
 103 | >>>     --mount=type=cache,target=/root/.cache \
 104 | >>>     --mount=type=cache,target=/go/pkg/mod \
 105 | >>>     --mount=type=bind,source=/tmp/.version,target=/tmp/.version,from=version \
 106 | >>>     --mount=type=bind,source=/tmp/.revision,target=/tmp/.revision,from=version <<EOT
 107 | >>>   set -ex
 108 | >>>   xx-go --wrap
 109 | >>>   make build-pass build-secretservice PACKAGE=$PACKAGE VERSION=$(cat /tmp/.version) REVISION=$(cat /tmp/.revision) DESTDIR=/out
 110 | >>>   xx-verify /out/docker-credential-pass
 111 | >>>   xx-verify /out/docker-credential-secretservice
 112 | >>> EOT
 113 |
--------------------
ERROR: failed to solve: process "/bin/sh -c   set -ex\n  xx-go --wrap\n  make build-pass build-secretservice PACKAGE=$PACKAGE VERSION=$(cat /tmp/.version) REVISION=$(cat /tmp/.revision) DESTDIR=/out\n  xx-verify /out/docker-credential-pass\n  xx-verify /out/docker-credential-secretservice\n" did not complete successfully: exit code: 2
@RunChuanYe
Copy link

same problem with me on ubuntu22.04

@noudin-ledger
Copy link

Same problem here with the Ubuntu 22.04

@crazy-max
Copy link
Member

I was able to repro on Ubuntu 22.04 with latest credential-helpers changes and Docker 24.0.2:

$ docker info
Client: Docker Engine - Community
 Version:    24.0.2
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.10.5
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.18.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 2
  Running: 2
  Paused: 0
  Stopped: 0
 Images: 3
 Server Version: 24.0.2
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 3dce8eb055cbb6872793272b4f20ed16117344f8
 runc version: v1.1.7-0-g860f061
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.19.0-1025-aws
 Operating System: Ubuntu 22.04.2 LTS
 OSType: linux
 Architecture: aarch64
 CPUs: 2
 Total Memory: 3.747GiB
 Name: ip-172-31-18-37
 ID: 98c07a3d-7666-48a4-92b0-a38eb58a0ff3
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
$ docker buildx bake "https://github.com/docker/docker-credential-helpers.git"
 => CANCELED [linux/arm64->darwin/amd64 build-darwin 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,from=osxcross,src=/o  199.5s
 => [linux/arm64->windows/arm64 build-windows 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,source=/tmp/.version,target  100.7s
 => CANCELED [linux/arm64->darwin/arm64 build-darwin 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,from=osxcross,src=/o  198.3s
 => [linux/arm64->windows/amd64 build-windows 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,source=/tmp/.version,target=  84.5s
 => [linux/arm64 binaries 1/1] COPY --from=build /out /                                                                                                                                                                     0.0s
 => [windows/arm64 binaries 1/1] COPY --from=build /out /                                                                                                                                                                   0.0s
 => ERROR [linux/arm64->s390x build-linux 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,source=/tmp/.version,target=/tmp  51.5s
 => CANCELED [linux/arm64->arm/v7 build-linux 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,source=/tmp/.version,target=  50.0s
 => CANCELED [linux/arm64->arm/v6 build-linux 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,source=/tmp/.version,target=  48.2s
 => [windows/amd64 binaries 1/1] COPY --from=build /out /                                                                                                                                                                   0.0s
 => CANCELED [linux/arm64->ppc64le build-linux 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,source=/tmp/.version,target  41.3s
 => CANCELED [linux/arm64->amd64 build-linux 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,source=/tmp/.version,target=/  38.1s
------
 > [linux/arm64->s390x build-linux 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,source=/tmp/.version,target=/tmp/.version,from=version     --mount=type=bind,source=/tmp/.revision,target=/tmp/.revision,from=version <<EOT (set -ex...):
#0 0.239 + xx-go --wrap
#0 0.456 + cat /tmp/.version
#0 0.463 + cat /tmp/.revision
#0 0.466 + make build-pass build-secretservice PACKAGE=github.com/docker/docker-credential-helpers VERSION= REVISION=.m DESTDIR=/out
#0 0.472 go build -trimpath -ldflags="-s -w -X github.com/docker/docker-credential-helpers/credentials.Version= -X github.com/docker/docker-credential-helpers/credentials.Revision=.m -X github.com/docker/docker-credential-helpers/credentials.Package=github.com/docker/docker-credential-helpers -X github.com/docker/docker-credential-helpers/credentials.Name=docker-credential-pass" -o "/out/docker-credential-pass" ./pass/cmd/
#0 46.29 go build -trimpath -ldflags="-s -w -X github.com/docker/docker-credential-helpers/credentials.Version= -X github.com/docker/docker-credential-helpers/credentials.Revision=.m -X github.com/docker/docker-credential-helpers/credentials.Package=github.com/docker/docker-credential-helpers -X github.com/docker/docker-credential-helpers/credentials.Name=docker-credential-secretservice" -o "/out/docker-credential-secretservice" ./secretservice/cmd/
#0 51.37 go build github.com/docker/docker-credential-helpers/secretservice:
#0 51.37 # s390x-linux-gnu-pkg-config --cflags  -- libsecret-1
#0 51.37 /usr/bin/s390x-linux-gnu-pkg-config: 23: exec: pkg-config: Exec format error
#0 51.37 s390x-linux-gnu-pkg-config: exit status 126
#0 51.37 make: *** [Makefile:21: build-secretservice] Error 1
------
Dockerfile:102
--------------------
 101 |     ARG PACKAGE
 102 | >>> RUN --mount=type=bind,target=. \
 103 | >>>     --mount=type=cache,target=/root/.cache \
 104 | >>>     --mount=type=cache,target=/go/pkg/mod \
 105 | >>>     --mount=type=bind,source=/tmp/.version,target=/tmp/.version,from=version \
 106 | >>>     --mount=type=bind,source=/tmp/.revision,target=/tmp/.revision,from=version <<EOT
 107 | >>>   set -ex
 108 | >>>   xx-go --wrap
 109 | >>>   make build-pass build-secretservice PACKAGE=$PACKAGE VERSION=$(cat /tmp/.version) REVISION=$(cat /tmp/.revision) DESTDIR=/out
 110 | >>>   xx-verify /out/docker-credential-pass
 111 | >>>   xx-verify /out/docker-credential-secretservice
 112 | >>> EOT
 113 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c   set -ex\n  xx-go --wrap\n  make build-pass build-secretservice PACKAGE=$PACKAGE VERSION=$(cat /tmp/.version) REVISION=$(cat /tmp/.revision) DESTDIR=/out\n  xx-verify /out/docker-credential-pass\n  xx-verify /out/docker-credential-secretservice\n" did not complete successfully: exit code: 2

Looking into it.

Replicate fail on Centos 7.9:

@vkimura What's the output of docker info?

@crazy-max
Copy link
Member

crazy-max commented May 28, 2023

Emulators need to be installed when building with Docker:

$ docker run --privileged --rm tonistiigi/binfmt --install all
$ docker buildx bake "https://github.com/docker/docker-credential-helpers.git"
[+] Building 50.2s (46/46) FINISHED                                                                                                                                                                                              
 => CACHED [internal] load git source https://github.com/docker/docker-credential-helpers.git                                                                                                                               0.9s
 => resolve image config for docker.io/docker/dockerfile:1                                                                                                                                                                  0.3s 
 => CACHED docker-image://docker.io/docker/dockerfile:1@sha256:39b85bbfa7536a5feceb7372a0817649ecb2724562a38360f4d6a7782a409b14                                                                                             0.0s 
 => => resolve docker.io/docker/dockerfile:1@sha256:39b85bbfa7536a5feceb7372a0817649ecb2724562a38360f4d6a7782a409b14                                                                                                        0.0s 
 => [linux/arm64 internal] load metadata for docker.io/library/golang:1.20.4-bullseye                                                                                                                                       0.3s 
 => [linux/arm64 internal] load metadata for docker.io/tonistiigi/xx:1.2.1                                                                                                                                                  0.3s 
 => [darwin/amd64 internal] load metadata for docker.io/crazymax/osxcross:11.3-r7-debian                                                                                                                                    0.3s
 => [darwin/arm64 internal] load metadata for docker.io/crazymax/osxcross:11.3-r7-debian                                                                                                                                    0.2s
 => CACHED [darwin/amd64 osxcross 1/1] FROM docker.io/crazymax/osxcross:11.3-r7-debian@sha256:d7cb4d9aa8108f5a93cfe6be371a049ffeea5a3871586d309106a27bd295bf60                                                              0.0s
 => => resolve docker.io/crazymax/osxcross:11.3-r7-debian@sha256:d7cb4d9aa8108f5a93cfe6be371a049ffeea5a3871586d309106a27bd295bf60                                                                                           0.0s
 => [linux/arm64 gobase 1/4] FROM docker.io/library/golang:1.20.4-bullseye@sha256:918857f4064db0fff49799ce5e7c4d43e394f452111cd89cca9af539c18a76a8                                                                          0.1s
 => => resolve docker.io/library/golang:1.20.4-bullseye@sha256:918857f4064db0fff49799ce5e7c4d43e394f452111cd89cca9af539c18a76a8                                                                                             0.0s
 => [linux/arm64 xx 1/1] FROM docker.io/tonistiigi/xx:1.2.1@sha256:8879a398dedf0aadaacfbd332b29ff2f84bc39ae6d4e9c0a1109db27ac5ba012                                                                                         0.1s
 => => resolve docker.io/tonistiigi/xx:1.2.1@sha256:8879a398dedf0aadaacfbd332b29ff2f84bc39ae6d4e9c0a1109db27ac5ba012                                                                                                        0.0s
 => CACHED [darwin/arm64 osxcross 1/1] FROM docker.io/crazymax/osxcross:11.3-r7-debian@sha256:d7cb4d9aa8108f5a93cfe6be371a049ffeea5a3871586d309106a27bd295bf60                                                              0.1s
 => => resolve docker.io/crazymax/osxcross:11.3-r7-debian@sha256:d7cb4d9aa8108f5a93cfe6be371a049ffeea5a3871586d309106a27bd295bf60                                                                                           0.0s
 => CACHED [linux/arm64 gobase 2/4] COPY --from=xx / /                                                                                                                                                                      0.0s
 => CACHED [linux/arm64 gobase 3/4] RUN apt-get update && apt-get install -y --no-install-recommends clang dpkg-dev file git lld llvm make pkg-config rsync                                                                 0.0s
 => CACHED [linux/arm64 gobase 4/4] WORKDIR /src                                                                                                                                                                            0.0s
 => CACHED [linux/arm64 version 1/1] RUN --mount=target=.     echo -n "$(./hack/git-meta version)" | tee /tmp/.version ; echo -n "$(./hack/git-meta revision)" | tee /tmp/.revision                                         0.0s
 => CACHED [linux/arm64->ppc64le base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                                                        0.0s
 => CACHED [linux/arm64->arm/v6 base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                                                         0.0s
 => CACHED [linux/arm64->amd64 base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                                                          0.0s
 => CACHED [linux/arm64->darwin/arm64 base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                                                   0.0s
 => CACHED [linux/arm64->darwin/amd64 base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                                                   0.0s
 => CACHED [linux/arm64->arm/v7 base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                                                         0.0s
 => CACHED [linux/arm64->s390x base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                                                          0.0s
 => CACHED [linux/arm64->windows/arm64 base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                                                  0.0s
 => CACHED [linux/arm64->windows/arm64 build-windows 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,source=/tmp/.version,t  0.0s
 => CACHED [windows/arm64 binaries 1/1] COPY --from=build /out /                                                                                                                                                            0.0s
 => CACHED [linux/arm64 base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                                                                 0.0s
 => CACHED [linux/arm64 build-linux 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,source=/tmp/.version,target=/tmp/.versi  0.0s
 => CACHED [linux/arm64 binaries 1/1] COPY --from=build /out /                                                                                                                                                              0.0s
 => CACHED [linux/arm64->windows/amd64 base 1/1] RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config                                                                                  0.0s
 => CACHED [linux/arm64->windows/amd64 build-windows 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,source=/tmp/.version,t  0.0s
 => CACHED [windows/amd64 binaries 1/1] COPY --from=build /out /                                                                                                                                                            0.0s
 => [linux/arm64->darwin/amd64 build-darwin 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,from=osxcross,src=/osxsdk,targ  46.0s
 => [linux/arm64->amd64 build-linux 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,source=/tmp/.version,target=/tmp/.vers  24.0s
 => [linux/arm64->arm/v7 build-linux 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,source=/tmp/.version,target=/tmp/.ver  15.8s
 => [linux/arm64->s390x build-linux 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,source=/tmp/.version,target=/tmp/.vers  12.7s
 => [linux/arm64->arm/v6 build-linux 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,source=/tmp/.version,target=/tmp/.ver  15.7s
 => [linux/arm64->ppc64le build-linux 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,source=/tmp/.version,target=/tmp/.ve  21.7s
 => [linux/arm64->darwin/arm64 build-darwin 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,from=osxcross,src=/osxsdk,targ  46.0s
 => [linux/s390x binaries 1/1] COPY --from=build /out /                                                                                                                                                                     0.0s
 => [linux/arm/v6 binaries 1/1] COPY --from=build /out /                                                                                                                                                                    0.1s
 => [linux/arm/v7 binaries 1/1] COPY --from=build /out /                                                                                                                                                                    0.0s
 => [linux/ppc64le binaries 1/1] COPY --from=build /out /                                                                                                                                                                   0.0s
 => [linux/amd64 binaries 1/1] COPY --from=build /out /                                                                                                                                                                     0.0s
 => [darwin/arm64 binaries 1/1] COPY --from=build /out /                                                                                                                                                                    0.0s 
 => [darwin/amd64 binaries 1/1] COPY --from=build /out /                                                                                                                                                                    0.0s 
 => exporting to client directory                                                                                                                                                                                           0.7s 
 => => copying files linux/arm64 3.58MB                                                                                                                                                                                     0.6s
 => => copying files darwin/amd64 4.03MB                                                                                                                                                                                    0.7s
 => => copying files darwin/arm64 4.08MB                                                                                                                                                                                    0.7s
 => => copying files windows/arm64 1.91MB                                                                                                                                                                                   0.3s
 => => copying files linux/amd64 3.57MB                                                                                                                                                                                     0.6s
 => => copying files linux/arm/v7 3.58MB                                                                                                                                                                                    0.6s
 => => copying files linux/arm/v6 3.58MB                                                                                                                                                                                    0.6s
 => => copying files linux/ppc64le 3.61MB                                                                                                                                                                                   0.6s
 => => copying files linux/s390x 3.93MB                                                                                                                                                                                     0.7s
 => => copying files windows/amd64 1.95MB

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 a pull request may close this issue.

4 participants