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

libc-bin segfaults ( script subprocess returned error exit status 139 ) ( qemu: uncaught target signal 11 (Segmentation fault) - core dumped ) #314

Closed
benchonaut opened this issue Jun 22, 2020 · 13 comments

Comments

@benchonaut
Copy link

Multi-image builds segfault with the famous: installed libc-bin package post-installation script subprocess returned error exit status 139 , adding ||true in dockerfile does not help , since dpkg does not even extract new packages

Countermeasures tried:

  • rm /var/cache/ldconfig/aux-cache 2>/dev/null|| true ;/sbin/ldconfig || true
  • apt-get -y --reinstall install libc-bin
  • lowering IPv6 Preferences in /etc/gai.conf
  • (not possible in docker ,but suggested ) options single-request timeout:2 attempts:2 ndots:2" /etc/resolv.conf || (echo "options single-request timeout:2 attempts:2 ndots:2" >> /etc/resolv.conf )

Nothing helps (!)

Build command line:

time docker buildx build --progress plain --network=host --memory-swap -1 --memory 1024 --platform=linux/amd64 --network=host --memory-swap -1 --memory 1024 -f Dockerfile .

Example Dockerfile (testing , the real ones are a bit more complex ;) )

FROM ubuntu:20.04

RUN uname -m
RUN id -un
RUN hostname

RUN apt-get update 
RUN apt-get -y install php-cli || true
RUN apt-get -y install curl || true
RUN echo precedence ::ffff:0:0/96 100|tee -a /etc/gai.conf
RUN dpkg --configure -D 777 libc-bin

RUN dpkg  --configure -a
RUN /usr/bin/curl -sS https://getcomposer.org/installer -o /tmp/composer.installer.php
RUN  php /tmp/composer.installer.php --install-dir=/usr/local/bin --filename=composer

RUN  export  LC_ALL=C.UTF-8 && apt-get update && LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php  && LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/apache2 && LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/pkg-gearman &&  apt-get update &&  apt-get install -y --no-install-recommends php7.4 php7.4-cli || true &&  apt-get autoremove -y --force-yes 


RUN apt-get update && apt-get dist-upgrade

Example Log:

#11 [ 8/14] RUN echo precedence ::ffff:0:0/96 100|tee -a /etc/gai.conf
#11 CACHED

#12 [ 9/14] RUN dpkg --configure -D 777 libc-bin
#12 0.402 D000001: ensure_diversions: new, (re)loading
#12 0.406 D000001: process queue pkg libc-bin:amd64 queue.len 0 progress 1, try 1
#12 0.407 D000040: checking dependencies of libc-bin:amd64 (- <none>)
#12 0.407 D000400:   checking group ...
#12 0.407 D000400:     checking possibility  -> libc6
#12 0.408 D000400:       checking non-provided pkg libc6:amd64
#12 0.409 D000400:       is installed, ok and found
#12 0.409 D000400:     found 3
#12 0.410 D000400:   found 3 matched 0 possfixbytrig -
#12 0.410 D000400:   checking group ...
#12 0.410 D000400:     checking possibility  -> libc6
#12 0.410 D000400:       checking non-provided pkg libc6:amd64
#12 0.410 D000400:       is installed, ok and found
#12 0.410 D000400:     found 3
#12 0.410 D000400:   found 3 matched 0 possfixbytrig -
#12 0.410 D000040: ok 2 msgs >><<
#12 0.411 D000040:     checking Breaks
#12 0.413 Setting up libc-bin (2.31-0ubuntu9) ...
#12 0.432 D000002: fork/exec /var/lib/dpkg/info/libc-bin.postinst ( configure 2.31-0ubuntu9 )
#12 0.738 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
#12 1.082 Segmentation fault (core dumped)
#12 1.229 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
#12 1.647 Segmentation fault (core dumped)
#12 1.659 dpkg: error processing package libc-bin (--configure):
#12 1.659  installed libc-bin package post-installation script subprocess returned error exit status 139
#12 1.661 D000001: ensure_diversions: same, skipping
#12 1.714 Errors were encountered while processing:
#12 1.714  libc-bin
#12 ERROR: executor failed running [/bin/sh -c dpkg --configure -D 777 libc-bin]: buildkit-runc did not terminate successfully

What to do ?

@rajsahae
Copy link

I am having this exact problem as well, and would very much appreciate any insight/workaround/solution?

@dennisameling
Copy link

I was using Debian bullyseye and ran into the same error; going back to buster fixed it for me 👍🏼

@altjx
Copy link

altjx commented Apr 30, 2021

Same issue here.

@dubo-dubon-duponey
Copy link

Definitely related: moby/qemu#19

@carlosedp
Copy link

carlosedp commented Aug 11, 2021

I'm having a similar behavior while building multi-arch images on an ARM64 workstation (16 cores, 32GB RAM).

My Dockerfile:

# Build with:
# docker buildx build -t carlosedp/eventrouter:latest --platform linux/amd64,linux/arm,linux/arm64,linux/arm,linux/ppc64le  -f Dockerfile-eventrouter --push .
#
FROM golang:1.16 as builder

RUN mkdir -p /go/src/github.com/openshift && \
    cd /go/src/github.com/openshift && \
    git clone https://github.com/openshift/eventrouter

RUN cd /go/src/github.com/openshift/eventrouter && CGO_ENABLED=0 go build .

FROM alpine:3.14 as run
WORKDIR /app
RUN apk update --no-cache && apk add ca-certificates
COPY --from=builder /go/src/github.com/openshift/eventrouter/eventrouter /app/eventrouter
USER nobody:nobody
CMD ["/bin/sh", "-c", "/app/eventrouter -v 3 -logtostderr"]

The run and error:

❯ docker buildx build -t carlosedp/eventrouter:latest --platform linux/amd64,linux/arm,linux/arm64,linux/arm,linux/ppc64le  -f Dockerfile-eventrouter --push .
[+] Building 108.5s (36/38)
 => [internal] load build definition from Dockerfile-eventrouter                                                                                                                          0.0s
 => => transferring dockerfile: 735B                                                                                                                                                      0.0s
 => [internal] load .dockerignore                                                                                                                                                         0.0s
 => => transferring context: 2B                                                                                                                                                           0.0s
 => [linux/ppc64le internal] load metadata for docker.io/library/alpine:3.14                                                                                                              1.7s
 => [linux/ppc64le internal] load metadata for docker.io/library/golang:1.16                                                                                                              1.7s
 => [linux/arm/v7 internal] load metadata for docker.io/library/alpine:3.14                                                                                                               1.6s
 => [linux/arm/v7 internal] load metadata for docker.io/library/golang:1.16                                                                                                               1.5s
 => [linux/arm64 internal] load metadata for docker.io/library/alpine:3.14                                                                                                                1.6s
 => [linux/arm64 internal] load metadata for docker.io/library/golang:1.16                                                                                                                1.6s
 => [linux/amd64 internal] load metadata for docker.io/library/alpine:3.14                                                                                                                1.5s
 => [linux/amd64 internal] load metadata for docker.io/library/golang:1.16                                                                                                                1.5s
 => [linux/arm/v7 run 1/4] FROM docker.io/library/alpine:3.14@sha256:eb3e4e175ba6d212ba1d6e04fc0782916c08e1c9d7b45892e9796141b1d379ae                                                     0.1s
 => => resolve docker.io/library/alpine:3.14@sha256:eb3e4e175ba6d212ba1d6e04fc0782916c08e1c9d7b45892e9796141b1d379ae                                                                      0.1s
 => [linux/arm/v7 builder 1/3] FROM docker.io/library/golang:1.16@sha256:3c4de86eec9cbc619cdd72424abd88326ffcf5d813a8338a7743c55e5898734f                                                 0.1s
 => => resolve docker.io/library/golang:1.16@sha256:3c4de86eec9cbc619cdd72424abd88326ffcf5d813a8338a7743c55e5898734f                                                                      0.1s
 => [linux/amd64 run 1/4] FROM docker.io/library/alpine:3.14@sha256:eb3e4e175ba6d212ba1d6e04fc0782916c08e1c9d7b45892e9796141b1d379ae                                                      0.0s
 => => resolve docker.io/library/alpine:3.14@sha256:eb3e4e175ba6d212ba1d6e04fc0782916c08e1c9d7b45892e9796141b1d379ae                                                                      0.0s
 => [linux/amd64 builder 1/3] FROM docker.io/library/golang:1.16@sha256:3c4de86eec9cbc619cdd72424abd88326ffcf5d813a8338a7743c55e5898734f                                                  0.1s
 => => resolve docker.io/library/golang:1.16@sha256:3c4de86eec9cbc619cdd72424abd88326ffcf5d813a8338a7743c55e5898734f                                                                      0.1s
 => [linux/ppc64le builder 1/3] FROM docker.io/library/golang:1.16@sha256:3c4de86eec9cbc619cdd72424abd88326ffcf5d813a8338a7743c55e5898734f                                                0.1s
 => => resolve docker.io/library/golang:1.16@sha256:3c4de86eec9cbc619cdd72424abd88326ffcf5d813a8338a7743c55e5898734f                                                                      0.1s
 => [linux/ppc64le run 1/4] FROM docker.io/library/alpine:3.14@sha256:eb3e4e175ba6d212ba1d6e04fc0782916c08e1c9d7b45892e9796141b1d379ae                                                    0.1s
 => => resolve docker.io/library/alpine:3.14@sha256:eb3e4e175ba6d212ba1d6e04fc0782916c08e1c9d7b45892e9796141b1d379ae                                                                      0.0s
 => [linux/arm64 builder 1/3] FROM docker.io/library/golang:1.16@sha256:3c4de86eec9cbc619cdd72424abd88326ffcf5d813a8338a7743c55e5898734f                                                  0.1s
 => => resolve docker.io/library/golang:1.16@sha256:3c4de86eec9cbc619cdd72424abd88326ffcf5d813a8338a7743c55e5898734f                                                                      0.0s
 => [linux/arm64 run 1/4] FROM docker.io/library/alpine:3.14@sha256:eb3e4e175ba6d212ba1d6e04fc0782916c08e1c9d7b45892e9796141b1d379ae                                                      0.1s
 => => resolve docker.io/library/alpine:3.14@sha256:eb3e4e175ba6d212ba1d6e04fc0782916c08e1c9d7b45892e9796141b1d379ae                                                                      0.0s
 => CACHED [linux/amd64 run 2/4] WORKDIR /app                                                                                                                                             0.0s
 => CACHED [linux/amd64 run 3/4] RUN apk update --no-cache && apk add ca-certificates                                                                                                     0.0s
 => CACHED [linux/arm/v7 run 2/4] WORKDIR /app                                                                                                                                            0.0s
 => CACHED [linux/arm/v7 run 3/4] RUN apk update --no-cache && apk add ca-certificates                                                                                                    0.0s
 => CACHED [linux/arm/v7 builder 2/3] RUN mkdir -p /go/src/github.com/openshift &&     cd /go/src/github.com/openshift &&     git clone https://github.com/openshift/eventrouter          0.0s
 => [linux/arm/v7 builder 3/3] RUN cd /go/src/github.com/openshift/eventrouter && CGO_ENABLED=0 go build .                                                                               84.1s
 => CACHED [linux/amd64 builder 2/3] RUN mkdir -p /go/src/github.com/openshift &&     cd /go/src/github.com/openshift &&     git clone https://github.com/openshift/eventrouter           0.0s
 => ERROR [linux/amd64 builder 3/3] RUN cd /go/src/github.com/openshift/eventrouter && CGO_ENABLED=0 go build .                                                                         106.5s
 => CACHED [linux/ppc64le builder 2/3] RUN mkdir -p /go/src/github.com/openshift &&     cd /go/src/github.com/openshift &&     git clone https://github.com/openshift/eventrouter         0.0s
 => CACHED [linux/ppc64le run 2/4] WORKDIR /app                                                                                                                                           0.0s
 => CACHED [linux/ppc64le run 3/4] RUN apk update --no-cache && apk add ca-certificates                                                                                                   0.0s
 => CANCELED [linux/ppc64le builder 3/3] RUN cd /go/src/github.com/openshift/eventrouter && CGO_ENABLED=0 go build .                                                                    106.6s
 => CACHED [linux/arm64 builder 2/3] RUN mkdir -p /go/src/github.com/openshift &&     cd /go/src/github.com/openshift &&     git clone https://github.com/openshift/eventrouter           0.0s
 => [linux/arm64 builder 3/3] RUN cd /go/src/github.com/openshift/eventrouter && CGO_ENABLED=0 go build .                                                                                70.8s
 => CACHED [linux/arm64 run 2/4] WORKDIR /app                                                                                                                                             0.0s
 => CACHED [linux/arm64 run 3/4] RUN apk update --no-cache && apk add ca-certificates                                                                                                     0.0s
 => [linux/arm64 run 4/4] COPY --from=builder /go/src/github.com/openshift/eventrouter/eventrouter /app/eventrouter                                                                       0.1s
 => [linux/arm/v7 run 4/4] COPY --from=builder /go/src/github.com/openshift/eventrouter/eventrouter /app/eventrouter                                                                      0.2s
------
 > [linux/amd64 builder 3/3] RUN cd /go/src/github.com/openshift/eventrouter && CGO_ENABLED=0 go build .:
#23 16.97 # net
#23 16.97 SIGSEGV: segmentation violation
#23 16.97 PC=0x0 m=5 sigcode=0
#23 16.97
#23 16.97 goroutine 46 [running]:
#23 16.97 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
#23 34.39 # github.com/gogo/protobuf/proto
#23 34.39 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
#23 39.07 # k8s.io/apimachinery/third_party/forked/golang/reflect
#23 39.07 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
#23 39.52 # github.com/hashicorp/hcl/hcl/scanner
#23 39.52 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
#23 60.23 # k8s.io/apimachinery/pkg/util/clock
#23 60.23 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
#23 93.41 # github.com/prometheus/client_golang/prometheus/internal
#23 93.41 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
------
Dockerfile-eventrouter:10
--------------------
   8 |         git clone https://github.com/openshift/eventrouter
   9 |
  10 | >>> RUN cd /go/src/github.com/openshift/eventrouter && CGO_ENABLED=0 go build .
  11 |
  12 |     FROM alpine:3.14 as run
--------------------
error: failed to solve: process "/dev/.buildkit_qemu_emulator /bin/sh -c cd /go/src/github.com/openshift/eventrouter && CGO_ENABLED=0 go build ." did not complete successfully: exit code: 2

I believe cross-building from ARM64 to AMD64 and ppc64le are not supported since docker buildx ls shows: "compassionate_greider0 unix:///var/run/docker.sock running linux/arm64, linux/arm/v7, linux/arm/v6"

@dubo-dubon-duponey
Copy link

@carlosedp IIRC buildkit official image qemu bundled version is outdated.
Running qemu 6.0 has proven much better for me.

@carlosedp
Copy link

carlosedp commented Aug 11, 2021

I've installed latest Qemu on the Ubuntu 20.04 host.. it's 5.2.0 and checked that the emulator is using Qemu 6.0:

❯ docker run --privileged --rm tonistiigi/binfmt --version
binfmt/8703596 qemu/v6.0.0 go/1.16.5

Also I've registered all binfmt and used a cpu=max image from @tonistiigi:

docker run --privileged --rm tonistiigi/binfmt --install all
docker run -it --rm --privileged  tonistiigi/binfmt --uninstall qemu-x86_64
docker run -it --rm --privileged  tonistiigi/binfmt:qemu-v5.0.1-cpu-max --install amd64

I'm still seeing segfaults for both PPC64le and AMD64 cross-builds.

Ref.

@dubo-dubon-duponey
Copy link

qemu 5 simply did not work for me, and has been segfaulting a lot (specifically what is described in this ticket).

You might want to just uninstall qemu on the host entirely (I do not think you need it), then use Tonis binfmt image (or equivalent) to get just user qemu6 in.

Wishing you luck, this is a rabbit hole :)

@crazy-max
Copy link
Member

Can you try with the latest release (qemu 6.1.0)?:

$ docker pull tonistiigi/binfmt:latest
$ docker run --privileged --rm tonistiigi/binfmt --uninstall qemu-*
$ docker run --privileged --rm tonistiigi/binfmt --install all

We have also published a new image with qemu 6.2.0 (not latest atm)

$ docker pull tonistiigi/binfmt:qemu-v6.2.0

If it's still happening can you open a new issue with a complete repro so we can test on our side please? Thanks.

@carlosedp
Copy link

Re-creating the buildx instance and registering with Qemu (6.1) worked fine:

❯ docker buildx build -t carlosedp/eventrouter:latest --platform linux/amd64,linux/arm,linux/arm64,linux/arm,linux/ppc64le  -f Dockerfile.eventrouter .
WARN[0000] No output specified for docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
[+] Building 678.8s (45/45) FINISHED
 => [internal] booting buildkit                                                                                                                                                          13.4s
 => => pulling image moby/buildkit:buildx-stable-1                                                                                                                                       12.4s
 => => creating container buildx_buildkit_brave_zhukovsky0                                                                                                                                1.0s
 => [internal] load build definition from Dockerfile.eventrouter                                                                                                                          0.0s
 => => transferring dockerfile: 735B                                                                                                                                                      0.0s
 => [internal] load .dockerignore                                                                                                                                                         0.0s
 => => transferring context: 2B                                                                                                                                                           0.0s
 => [linux/ppc64le internal] load metadata for docker.io/library/golang:1.17                                                                                                             10.7s
 => [linux/ppc64le internal] load metadata for docker.io/library/alpine:3.15                                                                                                             13.0s
 => [linux/arm/v7 internal] load metadata for docker.io/library/alpine:3.15                                                                                                              12.7s
 => [linux/arm/v7 internal] load metadata for docker.io/library/golang:1.17                                                                                                              13.1s
 => [linux/arm64 internal] load metadata for docker.io/library/alpine:3.15                                                                                                               12.8s
 => [linux/arm64 internal] load metadata for docker.io/library/golang:1.17                                                                                                               13.2s
 => [linux/amd64 internal] load metadata for docker.io/library/alpine:3.15                                                                                                               13.1s
 => [linux/amd64 internal] load metadata for docker.io/library/golang:1.17                                                                                                               10.3s
 => [auth] library/golang:pull token for registry-1.docker.io                                                                                                                             0.0s
 => [auth] library/alpine:pull token for registry-1.docker.io                                                                                                                             0.0s
 => [auth] library/alpine:pull token for registry-1.docker.io                                                                                                                             0.0s
 => [auth] library/golang:pull token for registry-1.docker.io                                                                                                                             0.0s
 => [auth] library/alpine:pull token for registry-1.docker.io                                                                                                                             0.0s
 => [auth] library/golang:pull token for registry-1.docker.io                                                                                                                             0.0s
 => [linux/ppc64le run 1/4] FROM docker.io/library/alpine:3.15@sha256:21a3deaa0d32a8057914f36584b5288d2e5ecc984380bc0118285c70fa8c9300                                                    0.7s
 => => resolve docker.io/library/alpine:3.15@sha256:21a3deaa0d32a8057914f36584b5288d2e5ecc984380bc0118285c70fa8c9300                                                                      0.0s
 => => sha256:159b5dcb1717c815c76ff5ea1db730e18e8609c9090238e43282856db9e71f47 2.81MB / 2.81MB                                                                                            0.6s
 => => extracting sha256:159b5dcb1717c815c76ff5ea1db730e18e8609c9090238e43282856db9e71f47                                                                                                 0.1s
 => [linux/ppc64le builder 1/3] FROM docker.io/library/golang:1.17@sha256:1a35cc2c5338409227c7293add327ebe42e1ee5465049f6c57c829588e3f8a39                                               86.8s
 => => resolve docker.io/library/golang:1.17@sha256:1a35cc2c5338409227c7293add327ebe42e1ee5465049f6c57c829588e3f8a39                                                                      0.1s
 => => sha256:645c6777a3f458747bb2b8b78d88b199e07fa3bcf6c6ea45cafcdb47041f237e 156B / 156B                                                                                                0.4s
 => => sha256:9697483dc2fc83a2f84a42657c7e66cda1dd0c5610ed2d21749a2b2824635181 101.06MB / 101.06MB                                                                                       27.8s
 => => sha256:7c968dbebeddb936a1364e7c321515fac2156989b082768c8ad60f43e4cd9524 80.29MB / 80.29MB                                                                                         24.6s
 => => sha256:3666fa80bd5ba710074e486db483ab18c486a7be1dec94061bc9e81c32bc110d 58.85MB / 58.85MB                                                                                         18.5s
 => => sha256:8199fa873cada4fef014c20726ab130549bd9ba220f667be9c63d8fbabfacc80 11.63MB / 11.63MB                                                                                          3.6s
 => => sha256:c0d4b2a71bc242bb2c81b203b94ce8cd6c281117b4cdb6386dca34b051bdcb1f 5.40MB / 5.40MB                                                                                            2.1s
 => => sha256:9ecf2845789585f183c7b423fece4a8a51e9f5753452de12292282be543e2500 58.83MB / 58.83MB                                                                                         15.6s
 => => extracting sha256:9ecf2845789585f183c7b423fece4a8a51e9f5753452de12292282be543e2500                                                                                                 2.7s
 => => extracting sha256:c0d4b2a71bc242bb2c81b203b94ce8cd6c281117b4cdb6386dca34b051bdcb1f                                                                                                 0.4s
 => => extracting sha256:8199fa873cada4fef014c20726ab130549bd9ba220f667be9c63d8fbabfacc80                                                                                                 0.3s
 => => extracting sha256:3666fa80bd5ba710074e486db483ab18c486a7be1dec94061bc9e81c32bc110d                                                                                                 2.9s
 => => extracting sha256:7c968dbebeddb936a1364e7c321515fac2156989b082768c8ad60f43e4cd9524                                                                                                 2.7s
 => => extracting sha256:9697483dc2fc83a2f84a42657c7e66cda1dd0c5610ed2d21749a2b2824635181                                                                                                 5.2s
 => => extracting sha256:645c6777a3f458747bb2b8b78d88b199e07fa3bcf6c6ea45cafcdb47041f237e                                                                                                 0.0s
 => [linux/arm/v7 builder 1/3] FROM docker.io/library/golang:1.17@sha256:1a35cc2c5338409227c7293add327ebe42e1ee5465049f6c57c829588e3f8a39                                                40.0s
 => => resolve docker.io/library/golang:1.17@sha256:1a35cc2c5338409227c7293add327ebe42e1ee5465049f6c57c829588e3f8a39                                                                      0.0s
 => => sha256:a1841b5cc3f2a50ef771f5037a94565292edf16868e278bc18bd4af6eec80d6b 156B / 156B                                                                                                0.4s
 => => sha256:da1e38761f4c3c5db6e46eb370b006bd067fa214e797817ecb83adfc7cee09e7 103.09MB / 103.09MB                                                                                       34.6s
 => => sha256:e24126aa02d6fd7694a9ee89072fac017f1c227aaa47dfe47129ff1f52a5a00f 64.76MB / 64.76MB                                                                                         15.4s
 => => sha256:f9436ef0f28d4835e8f606ab54b1c3982ebba4b0ea19b88e655a8c5c2e973c46 50.33MB / 50.33MB                                                                                          9.3s
 => => sha256:ce0e88eaa9f33e97d48fa77ed2c178123150031494073f10c97755b3bd6370c1 10.22MB / 10.22MB                                                                                          1.3s
 => => sha256:e29bf76217944d3c3b29fb3234ed71ba5a004ffcec0595d3704c6e6cfa169b68 4.92MB / 4.92MB                                                                                            1.0s
 => => sha256:046501ac4c58f014cc320324f6023bbef17f28025428833449198a62a97849c0 50.12MB / 50.12MB                                                                                         11.1s
 => => extracting sha256:046501ac4c58f014cc320324f6023bbef17f28025428833449198a62a97849c0                                                                                                 2.1s
 => => extracting sha256:e29bf76217944d3c3b29fb3234ed71ba5a004ffcec0595d3704c6e6cfa169b68                                                                                                 0.3s
 => => extracting sha256:ce0e88eaa9f33e97d48fa77ed2c178123150031494073f10c97755b3bd6370c1                                                                                                 0.2s
 => => extracting sha256:f9436ef0f28d4835e8f606ab54b1c3982ebba4b0ea19b88e655a8c5c2e973c46                                                                                                 2.4s
 => => extracting sha256:e24126aa02d6fd7694a9ee89072fac017f1c227aaa47dfe47129ff1f52a5a00f                                                                                                 1.8s
 => => extracting sha256:da1e38761f4c3c5db6e46eb370b006bd067fa214e797817ecb83adfc7cee09e7                                                                                                 4.9s
 => => extracting sha256:a1841b5cc3f2a50ef771f5037a94565292edf16868e278bc18bd4af6eec80d6b                                                                                                 0.0s
 => [linux/arm/v7 run 1/4] FROM docker.io/library/alpine:3.15@sha256:21a3deaa0d32a8057914f36584b5288d2e5ecc984380bc0118285c70fa8c9300                                                     0.9s
 => => resolve docker.io/library/alpine:3.15@sha256:21a3deaa0d32a8057914f36584b5288d2e5ecc984380bc0118285c70fa8c9300                                                                      0.1s
 => => sha256:5480d2ca1740c20ce17652e01ed2265cdc914458acd41256a2b1ccff28f2762c 2.43MB / 2.43MB                                                                                            0.8s
 => => extracting sha256:5480d2ca1740c20ce17652e01ed2265cdc914458acd41256a2b1ccff28f2762c                                                                                                 0.1s
 => [linux/arm64 builder 1/3] FROM docker.io/library/golang:1.17@sha256:1a35cc2c5338409227c7293add327ebe42e1ee5465049f6c57c829588e3f8a39                                                 98.7s
 => => resolve docker.io/library/golang:1.17@sha256:1a35cc2c5338409227c7293add327ebe42e1ee5465049f6c57c829588e3f8a39                                                                      0.1s
 => => sha256:5d3482f19e9d1f84afe6f7c0a39ea57ae017427d9fa28e569cdeb99f369dd014 125B / 125B                                                                                                0.3s
 => => sha256:c0e75b22fa97d2697a51133cad6ef81e3d0b5dc7cdd875e2efab568c1f9e5a19 102.66MB / 102.66MB                                                                                       25.0s
 => => sha256:ba82d658e35e283c3256d116f10873cc082c6131e4ed97c024fbca8bf221cef2 81.02MB / 81.02MB                                                                                         16.5s
 => => sha256:4b9f1769d50d3693321e1b48f527d9c920830ad24d931b642c116bf7823bed6a 54.67MB / 54.67MB                                                                                         12.5s
 => => sha256:e019dd0368ba992803442a16cc7792c1bd5a3d06c3a1ae6fae17cb838822fb4c 10.66MB / 10.66MB                                                                                          4.3s
 => => sha256:0cf88d09fc28807e643d4f619b2e0c559aaeddc7d7b8176e1144b065d63fa160 5.14MB / 5.14MB                                                                                            1.7s
 => => sha256:39ab78bc09e79a21f719ced771689354d1948f4afd57e86afed8dac6ffb47826 53.61MB / 53.61MB                                                                                          7.7s
 => => extracting sha256:39ab78bc09e79a21f719ced771689354d1948f4afd57e86afed8dac6ffb47826                                                                                                 2.3s
 => => extracting sha256:0cf88d09fc28807e643d4f619b2e0c559aaeddc7d7b8176e1144b065d63fa160                                                                                                 0.3s
 => => extracting sha256:e019dd0368ba992803442a16cc7792c1bd5a3d06c3a1ae6fae17cb838822fb4c                                                                                                 0.2s
 => => extracting sha256:4b9f1769d50d3693321e1b48f527d9c920830ad24d931b642c116bf7823bed6a                                                                                                 3.1s
 => => extracting sha256:ba82d658e35e283c3256d116f10873cc082c6131e4ed97c024fbca8bf221cef2                                                                                                 2.3s
 => => extracting sha256:c0e75b22fa97d2697a51133cad6ef81e3d0b5dc7cdd875e2efab568c1f9e5a19                                                                                                 5.7s
 => => extracting sha256:5d3482f19e9d1f84afe6f7c0a39ea57ae017427d9fa28e569cdeb99f369dd014                                                                                                 0.0s
 => [linux/amd64 builder 1/3] FROM docker.io/library/golang:1.17@sha256:1a35cc2c5338409227c7293add327ebe42e1ee5465049f6c57c829588e3f8a39                                                 64.6s
 => => resolve docker.io/library/golang:1.17@sha256:1a35cc2c5338409227c7293add327ebe42e1ee5465049f6c57c829588e3f8a39                                                                      0.1s
 => => sha256:8560fc463426dc7e494720250efec25cdae1c4bf796c1a0172f791c0c7dde1c6 156B / 156B                                                                                                0.8s
 => => sha256:c9cefb9872505d3a6fdcbbdbe4103393da3e384443c5a8cdd62bc368927ea1cc 134.83MB / 134.83MB                                                                                       35.5s
 => => sha256:9297634c9537024497f76a2e1b374d8a315baa21d45bf36dc7980dc42ab93b0b 85.81MB / 85.81MB                                                                                         20.2s
 => => sha256:461bb1d8c517c7f9fc0f1df66c9dc34c85a23421c1e1c540b2e28cbb258e75f5 54.57MB / 54.57MB                                                                                         15.9s
 => => sha256:e6d3e61f7a504fa66d7275123969e9917570188650eb84b2280a726b996040f6 10.87MB / 10.87MB                                                                                          3.8s
 => => sha256:412caad352a3ecbb29c080379407ae0761e7b9b454f7239cbfd1d1da25e06b29 5.15MB / 5.15MB                                                                                            1.6s
 => => sha256:0c6b8ff8c37e92eb1ca65ed8917e818927d5bf318b6f18896049b5d9afc28343 54.92MB / 54.92MB                                                                                         16.3s
 => => extracting sha256:0c6b8ff8c37e92eb1ca65ed8917e818927d5bf318b6f18896049b5d9afc28343                                                                                                 2.3s
 => => extracting sha256:412caad352a3ecbb29c080379407ae0761e7b9b454f7239cbfd1d1da25e06b29                                                                                                 0.3s
 => => extracting sha256:e6d3e61f7a504fa66d7275123969e9917570188650eb84b2280a726b996040f6                                                                                                 0.2s
 => => extracting sha256:461bb1d8c517c7f9fc0f1df66c9dc34c85a23421c1e1c540b2e28cbb258e75f5                                                                                                 2.5s
 => => extracting sha256:9297634c9537024497f76a2e1b374d8a315baa21d45bf36dc7980dc42ab93b0b                                                                                                 2.3s
 => => extracting sha256:c9cefb9872505d3a6fdcbbdbe4103393da3e384443c5a8cdd62bc368927ea1cc                                                                                                 5.6s
 => => extracting sha256:8560fc463426dc7e494720250efec25cdae1c4bf796c1a0172f791c0c7dde1c6                                                                                                 0.0s
 => [linux/arm64 run 1/4] FROM docker.io/library/alpine:3.15@sha256:21a3deaa0d32a8057914f36584b5288d2e5ecc984380bc0118285c70fa8c9300                                                      1.0s
 => => resolve docker.io/library/alpine:3.15@sha256:21a3deaa0d32a8057914f36584b5288d2e5ecc984380bc0118285c70fa8c9300                                                                      0.1s
 => => sha256:9b3977197b4f2147bdd31e1271f811319dcd5c2fc595f14e81f5351ab6275b99 2.72MB / 2.72MB                                                                                            0.9s
 => => extracting sha256:9b3977197b4f2147bdd31e1271f811319dcd5c2fc595f14e81f5351ab6275b99                                                                                                 0.1s
 => [linux/amd64 run 1/4] FROM docker.io/library/alpine:3.15@sha256:21a3deaa0d32a8057914f36584b5288d2e5ecc984380bc0118285c70fa8c9300                                                      0.9s
 => => resolve docker.io/library/alpine:3.15@sha256:21a3deaa0d32a8057914f36584b5288d2e5ecc984380bc0118285c70fa8c9300                                                                      0.0s
 => => sha256:59bf1c3509f33515622619af21ed55bbe26d24913cedbca106468a5fb37a50c3 2.82MB / 2.82MB                                                                                            0.8s
 => => extracting sha256:59bf1c3509f33515622619af21ed55bbe26d24913cedbca106468a5fb37a50c3                                                                                                 0.2s
 => [linux/ppc64le run 2/4] WORKDIR /app                                                                                                                                                  0.0s
 => [linux/ppc64le run 3/4] RUN apk update --no-cache && apk add ca-certificates                                                                                                         12.9s
 => [linux/arm/v7 run 2/4] WORKDIR /app                                                                                                                                                   0.0s
 => [linux/arm/v7 run 3/4] RUN apk update --no-cache && apk add ca-certificates                                                                                                           7.7s
 => [linux/amd64 run 2/4] WORKDIR /app                                                                                                                                                    0.0s
 => [linux/amd64 run 3/4] RUN apk update --no-cache && apk add ca-certificates                                                                                                           10.4s
 => [linux/arm64 run 2/4] WORKDIR /app                                                                                                                                                    0.0s
 => [linux/arm64 run 3/4] RUN apk update --no-cache && apk add ca-certificates                                                                                                            7.6s
 => [linux/arm/v7 builder 2/3] RUN mkdir -p /go/src/github.com/openshift &&     cd /go/src/github.com/openshift &&     git clone https://github.com/openshift/eventrouter                25.7s
 => [linux/amd64 builder 2/3] RUN mkdir -p /go/src/github.com/openshift &&     cd /go/src/github.com/openshift &&     git clone https://github.com/openshift/eventrouter                 37.5s
 => [linux/arm/v7 builder 3/3] RUN cd /go/src/github.com/openshift/eventrouter && CGO_ENABLED=0 go build .                                                                               43.8s
 => [linux/ppc64le builder 2/3] RUN mkdir -p /go/src/github.com/openshift &&     cd /go/src/github.com/openshift &&     git clone https://github.com/openshift/eventrouter               18.5s
 => [linux/arm64 builder 2/3] RUN mkdir -p /go/src/github.com/openshift &&     cd /go/src/github.com/openshift &&     git clone https://github.com/openshift/eventrouter                  8.1s
 => [linux/amd64 builder 3/3] RUN cd /go/src/github.com/openshift/eventrouter && CGO_ENABLED=0 go build .                                                                               518.6s
 => [linux/ppc64le builder 3/3] RUN cd /go/src/github.com/openshift/eventrouter && CGO_ENABLED=0 go build .                                                                             544.9s
 => [linux/arm64 builder 3/3] RUN cd /go/src/github.com/openshift/eventrouter && CGO_ENABLED=0 go build .                                                                                69.5s
 => [linux/arm/v7 run 4/4] COPY --from=builder /go/src/github.com/openshift/eventrouter/eventrouter /app/eventrouter                                                                      0.1s
 => [linux/arm64 run 4/4] COPY --from=builder /go/src/github.com/openshift/eventrouter/eventrouter /app/eventrouter                                                                       0.2s
 => [linux/amd64 run 4/4] COPY --from=builder /go/src/github.com/openshift/eventrouter/eventrouter /app/eventrouter                                                                       0.1s
 => [linux/ppc64le run 4/4] COPY --from=builder /go/src/github.com/openshift/eventrouter/eventrouter /app/eventrouter                                                                     0.1s

Thanks!

@anton-x-t
Copy link

anton-x-t commented Jan 4, 2024

Can you try with the latest release (qemu 6.1.0)?:

$ docker pull tonistiigi/binfmt:latest
$ docker run --privileged --rm tonistiigi/binfmt --uninstall qemu-*
$ docker run --privileged --rm tonistiigi/binfmt --install all

We have also published a new image with qemu 6.2.0 (not latest atm)

$ docker pull tonistiigi/binfmt:qemu-v6.2.0

If it's still happening can you open a new issue with a complete repro so we can test on our side please? Thanks.

@crazy-max Worked for me on Fedora 39 when pushing a multi-arch linux/amd64,linux/arm64 image. Thank you very much!!

@MrXhh
Copy link

MrXhh commented Mar 23, 2024

This fix my problem 👍 :+1 if this working for you.
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes -c yes

#1170 (comment)

@jpenglert
Copy link

jpenglert commented Jul 31, 2024

I hit this issue with GCP Cloud Build when installing ImageMagick in our Dockerfile via RUN apt-get update && apt-get install -y imagemagick.

Upgrading from linuxkit/binfmt:v0.7 to linuxkit/binfmt:v1.0.0 in our cloudbuild.yml file fixed the issue.

  # Build multi-architecture docker image
  - name: gcr.io/cloud-builders/docker
    args: ['run', '--privileged', 'linuxkit/binfmt:v1.0.0']
    id: initialize-qemu
  - name: gcr.io/cloud-builders/docker
    args: ['buildx', 'create', '--name', 'builder']
    id: create-builder
  - name: gcr.io/cloud-builders/docker
    args: ['buildx', 'use', 'builder']
    id: select-builder
  - name: gcr.io/cloud-builders/docker
    args: ['buildx', 'inspect', '--bootstrap']
    id: show-target-build-platforms
  - name: gcr.io/cloud-builders/docker
    args: ['buildx',
           'build',
           '--platform', '$_DOCKER_BUILDX_PLATFORMS',
           '-t', 'us.gcr.io/$PROJECT_ID/$REPO_NAME:$SHORT_SHA',
           '-t', 'us.gcr.io/$PROJECT_ID/$REPO_NAME:dev',
           '--push',
           '.']
    id: build-multi-architecture-container-image

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

No branches or pull requests