ryansch / docker-unifi-rpi

Unifi Controller for Raspberry Pi 3+ and x86
https://hub.docker.com/r/ryansch/unifi-rpi/
347 stars 42 forks source link

Error trying to build latest beta release with Docker 20.10.8 #80

Closed kfken closed 2 years ago

kfken commented 3 years ago

I'm trying to build, using Debian 11 amd64 and Docker 20.10.8, the latest beta release of Unifi (6.4.47) using an updated copy of Dockerfile.arm32v7 that I made to point to https://dl.ui.com/unifi/6.4.47-8c13da2a29/unifi_sysvinit_all.deb for the download. The build is failing:

docker build -pull -t 6.4.47-arm32v7 -f 6.4/Dockerfile.arm32v7 6.4 

<snip output>

Step 6/21 : FROM multiarch/qemu-user-static:arm as qemu
arm: Pulling from multiarch/qemu-user-static
Digest: sha256:c9eec5b5386724cba2caa7c05d9e04f568e1958b19fb69b6f858399038830dbd
Status: Image is up to date for multiarch/qemu-user-static:arm
 ---> 82574e4a61eb
Step 7/21 : FROM arm32v7/openjdk:8-slim-stretch
8-slim-stretch: Pulling from arm32v7/openjdk
Digest: sha256:8f69fedba2271e5b927a75394fd8e8c702892c2f40083d1c9f1624c76c43e6e9
Status: Image is up to date for arm32v7/openjdk:8-slim-stretch
 ---> 2c883270745f
Step 8/21 : LABEL maintainer="Ryan Schlesinger <ryan@ryanschlesinger.com>"
 ---> [Warning] The requested image's platform (linux/arm) does not match the detected host platform (linux/amd64) and no specific platform was requested
 ---> Running in e6a59d27a197
Removing intermediate container e6a59d27a197
 ---> 3ba8d14997c0
Step 9/21 : COPY --from=qemu /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
 ---> bdcc459b5d2b
Step 10/21 : COPY --from=tini /sbin/tini /sbin/tini
 ---> 273d7579f0d8
Step 11/21 : RUN apt-get update && apt-get install -y --no-install-recommends       wget       ca-certificates       gnupg       dirmngr       apt-transport-https     && rm -rf /var/lib/apt/lists/* &&     wget https://archive.raspbian.org/raspbian.public.key -O - | apt-key add - &&     echo 'deb https://archive.raspbian.org/raspbian stretch main contrib non-free' >> /etc/apt/sources.list
 ---> [Warning] The requested image's platform (linux/arm) does not match the detected host platform (linux/amd64) and no specific platform was requested
 ---> Running in 7af0e6ea9996
standard_init_linux.go:228: exec user process caused: exec format error
The command '/bin/sh -c apt-get update && apt-get install -y --no-install-recommends       wget       ca-certificates       gnupg       dirmngr       apt-transport-https     && rm -rf /var/lib/apt/lists/* &&     wget https://archive.raspbian.org/raspbian.public.key -O - | apt-key add - &&     echo 'deb https://archive.raspbian.org/raspbian stretch main contrib non-free' >> /etc/apt/sources.list' returned a non-zero code: 1

I've never had problems building other versions this way, any ideas what might be the cause?

kfken commented 2 years ago

Having the same issue with the latest build:

docker --version
Docker version 20.10.11, build dea9396

sudo ./build.sh -v  6.5.53 -u 6.5.53-63fe9ffd32 -t 6.5 -t 5 -t latest

<snip>

Step 6/21 : FROM multiarch/qemu-user-static:arm as qemu
arm: Pulling from multiarch/qemu-user-static
Digest: sha256:9df6edbb74bb3cda9514ba5f0c6a0584ef1525e8ae52ec39de0ac4b4cf2c04e0
Status: Image is up to date for multiarch/qemu-user-static:arm
 ---> 20e8aadc2b0c
Step 7/21 : FROM arm32v7/openjdk:8-slim-stretch
8-slim-stretch: Pulling from arm32v7/openjdk
Digest: sha256:8f69fedba2271e5b927a75394fd8e8c702892c2f40083d1c9f1624c76c43e6e9
Status: Image is up to date for arm32v7/openjdk:8-slim-stretch
 ---> 2c883270745f
Step 8/21 : LABEL maintainer="Ryan Schlesinger <ryan@ryanschlesinger.com>"
 ---> [Warning] The requested image's platform (linux/arm) does not match the detected host platform (linux/amd64) and no specific platform was requested
 ---> Running in 849288fb37e7
Removing intermediate container 849288fb37e7
 ---> d86c5ef81791
Step 9/21 : COPY --from=qemu /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
 ---> 0873e0b701c4
Step 10/21 : COPY --from=tini /sbin/tini /sbin/tini
 ---> 1cbf929377a5
Step 11/21 : RUN apt-get update && apt-get install -y --no-install-recommends       wget       ca-certificates       gnupg       dirmngr     && rm -rf /var/lib/apt/lists/* &&     wget https://archive.raspbian.org/raspbian.public.key -O - | apt-key add - &&     echo 'deb http://archive.raspbian.org/raspbian stretch main contrib non-free' >> /etc/apt/sources.list
 ---> [Warning] The requested image's platform (linux/arm) does not match the detected host platform (linux/amd64) and no specific platform was requested
 ---> Running in b3d42303d431
standard_init_linux.go:228: exec user process caused: exec format error
The command '/bin/sh -c apt-get update && apt-get install -y --no-install-recommends       wget       ca-certificates       gnupg       dirmngr     && rm -rf /var/lib/apt/lists/* &&     wget https://archive.raspbian.org/raspbian.public.key -O - | apt-key add - &&     echo 'deb http://archive.raspbian.org/raspbian stretch main contrib non-free' >> /etc/apt/sources.list' returned a non-zero code: 1
kfken commented 2 years ago

Also, I'm building on amd64, which perhaps is not the way the build scripts were intended, but in the past this didn't cause me any problems.

FWIW, this is the error I get trying to build on RPi 4:

--2021-11-21 17:15:40--  https://archive.raspbian.org/raspbian.public.key       
Resolving archive.raspbian.org (archive.raspbian.org)... 93.93.128.191          
Connecting to archive.raspbian.org (archive.raspbian.org)|93.93.128.191|:443... connected.
Warning: apt-key output should not be parsed (stdout is not a terminal)
ERROR: The certificate of ‘archive.raspbian.org’ is not trusted.
ERROR: The certificate of ‘archive.raspbian.org’ has expired.
gpg: no valid OpenPGP data found.
The command '/bin/sh -c apt-get update && apt-get install -y --no-install-recommends       wget   
    ca-certificates       gnupg       dirmngr     && rm -rf /var/lib/apt/lists/* &&     wget https
://archive.raspbian.org/raspbian.public.key -O - | apt-key add - &&     echo 'deb http://archive.r
aspbian.org/raspbian stretch main contrib non-free' >> /etc/apt/sources.list' returned a non-zero 
code: 2