Skip to content

Buildx failing to build for arm/v7 platform on arm64 machine #511

@antoninbas

Description

@antoninbas

I have the following builder, which should be able to build images for arm64 and arm/v7:

Name:   mybuild
Driver: docker-container

Nodes:
Name:      mybuild0
Endpoint:  unix:///var/run/docker.sock
Status:    running
Platforms: linux/arm64, linux/arm/v7, linux/arm/v6

I have the following Dockerfile:

FROM ubuntu:20.04
RUN date && sleep 10

I I run sudo docker buildx build --platform linux/arm64 --pull ., the image builds without issue. However, if I try to run sudo docker buildx build --platform linux/arm/v7 --pull ., I get the following:

 => ERROR [2/2] RUN date && sleep 10                                                                                                                                                                                                     0.3s
------
 > [2/2] RUN date && sleep 10:
#5 0.173 Tue May 26 11:21:31 UTC 1970
#5 0.175 sleep: cannot read realtime clock: Operation not permitted

I have confirmed that I can run containers without issue on my arm64 host, for either architecture:

####
$ sudo docker run --platform linux/arm/v7 ubuntu:20.04 bash -c "date && sleep 10 && date"
Wed Jan 20 03:01:54 UTC 2021
Wed Jan 20 03:02:04 UTC 2021
####
$ sudo docker run --platform linux/arm64 ubuntu:20.04 bash -c "date && sleep 10 && date"
Wed Jan 20 03:02:31 UTC 2021
Wed Jan 20 03:02:41 UTC 2021
#### failure expected, can't run amd64 binaries on arm64 host
$ sudo docker run --platform linux/amd64 ubuntu:20.04 bash -c "date && sleep 10 && date"
standard_init_linux.go:219: exec user process caused: exec format error

I saw multiple reports online pointing to an issue with libseccomp and recommending to update both docker and libseccomp on the host. However, both of them were recent "enough" in my case (20.10.2 for docker, 2.4.3-1ubuntu1 for libseccomp2). I even tried to install the most recent version of libssecomp - 2.5.1 - to no avail.

What's very interesting is if I start using ubuntu:18.04 as my base image - instead of ubuntu:20.04 - the buildx build can succeed without issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions