docker / buildx

Docker CLI plugin for extended build capabilities with BuildKit
Apache License 2.0
3.46k stars 466 forks source link

Multi arch builds fail on DroneCi in Docker #729

Closed modem7 closed 3 years ago

modem7 commented 3 years ago

When trying multi-arch build, it's now failing, unsure on why?

Drone pipeline:

kind: pipeline
type: docker
name: deploy

platform:
  os: linux
  arch: amd64

steps:
- name: latest  
  image: thegeeklab/drone-docker-buildx
  privileged: true
  settings:
    repo: modem7/dhcprelay
    purge: true
    compress: true
    cache_from: "modem7/dhcprelay:latest"
    platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8
    username:
      from_secret: docker_username
    password:
      from_secret: docker_password
    tags: latest

Dockerfile:

FROM alpine:edge
RUN apk update && apk add --no-cache dhcrelay
EXPOSE 67 67/udp
ENTRYPOINT ["dhcrelay", "-d"]
LABEL maintainer="Alex Lane"

Error:

error: failed to solve: rpc error: code = Unknown desc = process "/dev/.buildkit_qemu_emulator /bin/sh -c apk add --no-cache dhcrelay" did not complete successfully: exit code: 1

time="2021-08-13T01:32:49Z" level=error msg="execution failed: exit status 1"

https://drone.modem7.com/modem7/DHCP-Relay/19

The last time this worked was about 14 days ago (https://drone.modem7.com/modem7/DHCP-Relay/10/)

It could be an ID10T issue, so apologies if so, still quite new to drone/buildx/multi-arch builds.

The build works with just linux/amd64 selected, it also works with other projects based on alpine (eg https://drone.modem7.com/modem7/docker-starwars/17)

modem7 commented 3 years ago

OK, I seem to have resolved it.

Need to run "docker run --privileged --rm tonistiigi/binfmt --install all" for everything to work.

Info from https://github.com/docker/buildx#building-multi-platform-images