-
Notifications
You must be signed in to change notification settings - Fork 616
Description
I have this Dockerfile:
FROM python:3.6-slim
RUN apt-get update && apt-get install -y --no-install-recommends make
When I run this command:
docker buildx build . --pull --platform linux/arm/v5
I get this output:
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 27.3s (6/6) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 129B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/python:3.6-slim 0.6s
=> [auth] library/python:pull token for registry-1.docker.io 0.0s
=> CACHED [1/2] FROM docker.io/library/python:3.6-slim@sha256:200bc4213e83751cc4a5496e72573ce8173713fc73266a1fd3ec62bd378a5890 0.0s
=> => resolve docker.io/library/python:3.6-slim@sha256:200bc4213e83751cc4a5496e72573ce8173713fc73266a1fd3ec62bd378a5890 0.0s
=> ERROR [2/2] RUN apt-get update && apt-get install -y --no-install-recommends make 26.6s
------
> [2/2] RUN apt-get update && apt-get install -y --no-install-recommends make:
#6 0.582 Get:1 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
#6 0.583 Get:2 http://deb.debian.org/debian buster InRelease [121 kB]
#6 0.679 Get:3 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
#6 2.670 Get:4 http://security.debian.org/debian-security buster/updates/main armel Packages [232 kB]
#6 4.570 Get:5 http://deb.debian.org/debian buster/main armel Packages [7627 kB]
#6 6.556 Get:6 http://deb.debian.org/debian buster-updates/main armel Packages [7860 B]
#6 8.912 Fetched 8106 kB in 8s (962 kB/s)
#6 8.912 Reading package lists...
#6 16.39 Reading package lists...
#6 23.71 Building dependency tree...
#6 24.28 Reading state information...
#6 24.65 Suggested packages:
#6 24.65 make-doc
#6 25.19 The following NEW packages will be installed:
#6 25.19 make
#6 25.39 0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
#6 25.39 Need to get 327 kB of archives.
#6 25.39 After this operation, 1300 kB of additional disk space will be used.
#6 25.39 Get:1 http://deb.debian.org/debian buster/main armel make armel 4.2.1-1.2 [327 kB]
#6 26.17 debconf: delaying package configuration, since apt-utils is not installed
#6 26.29 Fetched 327 kB in 0s (2000 kB/s)
#6 26.37 Error while loading /usr/sbin/dpkg-split: No such file or directory
#6 26.38 Error while loading /usr/sbin/dpkg-deb: No such file or directory
#6 26.38 dpkg: error processing archive /var/cache/apt/archives/make_4.2.1-1.2_armel.deb (--unpack):
#6 26.38 dpkg-deb --control subprocess returned error exit status 1
#6 26.40 Errors were encountered while processing:
#6 26.40 /var/cache/apt/archives/make_4.2.1-1.2_armel.deb
#6 26.50 E: Sub-process /usr/bin/dpkg returned an error code (1)
------
Dockerfile:3
--------------------
1 | FROM python:3.6-slim
2 |
3 | >>> RUN apt-get update && apt-get install -y --no-install-recommends make
4 |
--------------------
error: failed to solve: rpc error: code = Unknown desc = executor failed running [/dev/.buildkit_qemu_emulator /bin/sh -c apt-get update && apt-get install -y --no-install-recommends make]: exit code: 100
Some observations:
It seems like it's looking for /usr/sbin/dpkg-split and /usr/sbin/dpkg-deb, even though those are located in the /usr/bin folder.
Platforms linux/arm/v7 and linux/arm/v8 both fail, however linux/amd64 does not fail.
Changing my Dockerfile to use FROM python:3.6 (instead of slim) builds correctly for all cases (armv5, armv7, arm64v8, amd64), and manually starting a container (after doing the multiarch qemu setup) with docker run -it --rm arm32v5/python:3.6-slim bash allows me to install make just fine.
I wasn't sure if this was a buildx issue or just a python-slim issue, but I was also able to do this as my Dockerfile:
FROM arm32v5/python:3.6-slim
RUN apt-get update && apt-get install -y --no-install-recommends make
and do a regular docker build:
docker build . --pull
and it builds correctly. So my guess is it has something to do with buildx? Unless arm32v5/python:3.6-slim is different than python:3.6-slim that buildx would be pulling.
This might be related to #493, not entirely sure.