docker-node
docker-node copied to clipboard
failing to build on raspi zero w
Environment
- Platform: Linux raspberrypi 5.10.52+ #1440 Tue Jul 27 09:53:08 BST 2021 armv6l GNU/Linux. (Raspberry pi Zero W)
- Docker Version: 20.10.8
- Node.js Version:
- Image Tag: node:current-alpine3.14
I am trying to build the Dozzle project's Dockerfile on my Raspberry pi Zero W: https://github.com/amir20/dozzle/blob/master/Dockerfile
The raspizerow is a linux/arm/v6 platform, so I have modified the Dockerfile to use
Build assets
FROM node:current-alpine3.14 as node
Since node:current-alpine3.14 is listed as having an armv6 image in hub.docker.com here: https://hub.docker.com/layers/node/library/node/current-alpine3.14/images/sha256-bc838a6daf88a490c81c3a85e77c65f1580d0c736fe0bbab29e32583a76afbaf?context=explore
I pulled the image locally with: docker pull --platform=linux/arm/v6 node:current-alpine3.14
I can't even get past the first command in the Dockerfile, which is RUN apk update
pi@raspberrypi:~/dozzle $ docker build -t hemna6969/dozzle .
Sending build context to Docker daemon 25.53MB
Step 1/25 : FROM node:current-alpine3.14 as node
---> 62207c52e2b9
Step 2/25 : RUN apk update
---> [Warning] The requested image's platform (linux/arm/v7) does not match the detected host platform (linux/arm/v6) and no specific platform was requested
---> Running in 513d6fe23617
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/armhf/APKINDEX.tar.gz
ERROR: https://dl-cdn.alpinelinux.org/alpine/v3.14/main: temporary error (try again later)
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.14/main: No such file or directory
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/armhf/APKINDEX.tar.gz
3069805456:error:0D0D90AD:asn1 encoding routines:ASN1_TIME_adj:error getting time:crypto/asn1/a_time.c:330:
3069805456:error:0D0D90AD:asn1 encoding routines:ASN1_TIME_adj:error getting time:crypto/asn1/a_time.c:330:
3069805456:error:0D0D90AD:asn1 encoding routines:ASN1_TIME_adj:error getting time:crypto/asn1/a_time.c:330:
3069805456:error:0D0D90AD:asn1 encoding routines:ASN1_TIME_adj:error getting time:crypto/asn1/a_time.c:330:
3069805456:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1913:
ERROR: https://dl-cdn.alpinelinux.org/alpine/v3.14/community: Permission denied
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.14/community: No such file or directory
2 errors; 16 distinct packages available
The command '/bin/sh -c apk update' returned a non-zero code: 2
Not sure if you have fixed this issue. Because you added a new paramater --platform=$BUILDPLATFORM
and move to latest version already (node:19-alpine
)
But from my view, you don't have to nominate the platform when run the build on proper platform already.
FROM node:19-alpine as node
This image node:19-alpine
included multi-arch already.
(not sure why it missed linux/arm/v7
, but this is not related to current problem)
when docker build
on platform linux/arm/v6
, it will pull the image for that platform automatically.
If you stuck at begin, maybe you point to wrong platform with --platform=$BUILDPLATFORM
If you need build for multi-arch, use command docker buildx
, you can take the reference on this file I did
docker buildx build --no-cache --push \
--platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x \
-t ${image}:latest -t ${image}:${VERSION} .
ref: https://github.com/alpine-docker/semver/blob/master/build.sh