Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] RPi Arm V7 & 8 Docker support revisited #130

Merged
merged 2 commits into from
Aug 7, 2021

Conversation

evroon
Copy link
Contributor

@evroon evroon commented Aug 7, 2021

evroon /feature-arm-docker → Lissy93/dashy Commits: 2 | Files Changed: 4 | Additions: 94 evroon Powered by Pull Request Badge

Category:
Feature, Docker

Overview
Add two Dockerfiles for ARMv7 and ARMv8 builds such that Dashy can be deployed on Raspberry Pi's for instance.

See also PR #122

Issue Number #117

New Vars
The hooks/pre-build script has to be executed before building the images to enable QEMU.

Code Quality Checklist (Please complete)

  • All changes are backwards compatible
  • All lint checks and tests are passing
  • There are no (new) build warnings or errors
  • Bumps version, if new feature added

Uses QEMU to build the docker images on amd64 architectures, such that Docker Hub can build the images.
@evroon evroon requested a review from Lissy93 as a code owner August 7, 2021 14:43
@netlify
Copy link

netlify bot commented Aug 7, 2021

✔️ Deploy Preview for dashy-dev ready!

🔨 Explore the source changes: 8f1201b

🔍 Inspect the deploy log: https://app.netlify.com/sites/dashy-dev/deploys/610e9c19f7945e00095e4499

😎 Browse the preview: https://deploy-preview-130--dashy-dev.netlify.app

@evroon
Copy link
Contributor Author

evroon commented Aug 7, 2021

I can build the Docker images myself after executing the hooks/pre-build script. This script should automatically be executed from what I understand by Docker Hub according to its documentation.

@Lissy93
Copy link
Owner

Lissy93 commented Aug 7, 2021

Amazing! Thanks so much, this looks great, just testing it now :)

@evroon
Copy link
Contributor Author

evroon commented Aug 7, 2021

And I made a small change to Dockerfile to reduce the number of steps (typically one combines multiple related ENV or RUN etc. statements in one line to reduce the number of steps. That will reduce the space needed and fasten the build).

@Lissy93 Lissy93 merged commit 72723f2 into Lissy93:master Aug 7, 2021
@evroon
Copy link
Contributor Author

evroon commented Aug 7, 2021

I don't know how Docker Hub works exactly, but you probably have to use something like the settings they describe here.

@Lissy93
Copy link
Owner

Lissy93 commented Aug 7, 2021

Ahh so it looks like the build still failed on DockerHub with the same error.

Build Logs

Cloning into '.'...
Warning: Permanently added the RSA host key for IP address '140.82.114.4' to the list of known hosts.
Reset branch 'master'
Your branch is up-to-date with 'origin/master'.
Pulling cache layers for index.docker.io/lissy93/dashy:arm32v7...
Done!
KernelVersion: 4.4.0-1060-aws
Components: [{u'Version': u'20.10.7', u'Name': u'Engine', u'Details': {u'KernelVersion': u'4.4.0-1060-aws', u'Os': u'linux', u'BuildTime': u'2021-06-02T11:54:58.000000000+00:00', u'ApiVersion': u'1.41', u'MinAPIVersion': u'1.12', u'GitCommit': u'b0f5bc3', u'Arch': u'amd64', u'Experimental': u'false', u'GoVersion': u'go1.13.15'}}, {u'Version': u'1.4.6', u'Name': u'containerd', u'Details': {u'GitCommit': u'd71fcd7d8303cbf684402823e425e9dd2e99285d'}}, {u'Version': u'1.0.0-rc95', u'Name': u'runc', u'Details': {u'GitCommit': u'b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7'}}, {u'Version': u'0.19.0', u'Name': u'docker-init', u'Details': {u'GitCommit': u'de40ad0'}}]
Arch: amd64
BuildTime: 2021-06-02T11:54:58.000000000+00:00
ApiVersion: 1.41
Platform: {u'Name': u'Docker Engine - Community'}
Version: 20.10.7
MinAPIVersion: 1.12
GitCommit: b0f5bc3
Os: linux
GoVersion: go1.13.15
Buildkit: Starting build for index.docker.io/lissy93/dashy:arm32v7...
WARNING: Support for the legacy ~/.dockercfg configuration file and file-format is deprecated and will be removed in an upcoming release
#1 [internal] load build definition from Dockerfile-arm32v7
#1 sha256:c44c33d1733a4bf4bbba713586ca8e2d26b61d115f1d3ca8918a0577e56c02e5
#1 transferring dockerfile: 1.28kB done
#1 DONE 0.1s
#2 [internal] load .dockerignore
#2 sha256:8c5b3064c712fe3392778fd5150bd8f52636793cf9f1e06215d36344402312fb
#2 transferring context: 2B done
#2 DONE 0.0s
#5 [auth] arm32v7/alpine:pull token for registry-1.docker.io
#5 sha256:4d3f2b084db13b0ae6157a4d486565e811848c3422e8945395fd41e51b68ff2a
#5 DONE 0.0s
#6 [auth] library/alpine:pull token for registry-1.docker.io
#6 sha256:2fd91380dffad65654e137cfed613971bf189033d6026cc041ac0e4edb8f81ff
#6 DONE 0.0s
#4 [internal] load metadata for docker.io/library/alpine:3.12
#4 sha256:dcbe6445faecb6a0adf28cc54a74893ed6f37ff445088ba92e20e9178ed92ea3
#4 ...
#3 [internal] load metadata for docker.io/arm32v7/alpine:3.12
#3 sha256:81f15d1167c63e6c2580725362c9c83e7e3e926ba724c4a98304cc5adc3b141d
#3 DONE 0.5s
#4 [internal] load metadata for docker.io/library/alpine:3.12
#4 sha256:dcbe6445faecb6a0adf28cc54a74893ed6f37ff445088ba92e20e9178ed92ea3
#4 DONE 0.5s
#18 importing cache manifest from index.docker.io/lissy93/dashy:arm32v7
#18 sha256:b532fcd6e6cecf0a678d01e7b48cce5f5c21f77af304b7abccaae854c74b82d6
#18 DONE 0.0s
#7 [stage-1 1/8] FROM docker.io/arm32v7/alpine:3.12@sha256:661f5f8a5351e8e7448f1749172737359bf9e3f3548046b309e2d64e1471a8dd
#7 sha256:4a3b5a5eb0b6193fab1db88c93270979a04e210ce7373b47921a061c46b35e9d
#7 resolve docker.io/arm32v7/alpine:3.12@sha256:661f5f8a5351e8e7448f1749172737359bf9e3f3548046b309e2d64e1471a8dd 0.0s done
#7 sha256:661f5f8a5351e8e7448f1749172737359bf9e3f3548046b309e2d64e1471a8dd 528B / 528B done
#7 sha256:217f01431a6898ef6cb7eef6616ed05abb3803781ff793c90a646aa54c37085c 1.48kB / 1.48kB done
#7 sha256:420c7481a3a76d5d12df768d2745ddbe40357df0af780c756a5a7d1f2a43d288 0B / 2.41MB 0.1s
#7 sha256:420c7481a3a76d5d12df768d2745ddbe40357df0af780c756a5a7d1f2a43d288 2.41MB / 2.41MB 0.3s done
#7 extracting sha256:420c7481a3a76d5d12df768d2745ddbe40357df0af780c756a5a7d1f2a43d288
#7 extracting sha256:420c7481a3a76d5d12df768d2745ddbe40357df0af780c756a5a7d1f2a43d288 1.2s done
#7 DONE 2.1s
#13 [internal] load build context
#13 sha256:2a470ac42133adffde84cf6895e730a79273aba1d488f9dc3db46320a5b5b08b
#13 ...
#8 [builder 1/2] FROM docker.io/library/alpine:3.12@sha256:de25c7fc6c4f3a27c7f0c2dff454e4671823a34d88abd533f210848d527e0fbb
#8 sha256:61ce958cc07df85523bc25b4a9c313460f102e888d867dc238adc6efc1cb88f4
#8 resolve docker.io/library/alpine:3.12@sha256:de25c7fc6c4f3a27c7f0c2dff454e4671823a34d88abd533f210848d527e0fbb 0.0s done
#8 sha256:de25c7fc6c4f3a27c7f0c2dff454e4671823a34d88abd533f210848d527e0fbb 1.64kB / 1.64kB done
#8 sha256:a9c28c813336ece5bb98b36af5b66209ed777a394f4f856c6e62267790883820 528B / 528B done
#8 sha256:13621d1b12d4d0d4ad6699d220cd46f26764a9daf26a95f792ab2ce0715df366 1.47kB / 1.47kB done
#8 sha256:339de151aab4bc06eed8409daae147c408478cb538dacb90cc63f19ad4eba80b 2.80MB / 2.80MB 0.2s done
#8 extracting sha256:339de151aab4bc06eed8409daae147c408478cb538dacb90cc63f19ad4eba80b 1.7s done
#8 DONE 2.3s
#13 [internal] load build context
#13 sha256:2a470ac42133adffde84cf6895e730a79273aba1d488f9dc3db46320a5b5b08b
#13 transferring context: 97.86MB 4.4s
#13 ...
#9 [builder 2/2] RUN QEMU_URL=https://github.com/balena-io/qemu/releases/download/v5.2.0%2Bbalena4/qemu-5.2.0.balena4-arm.tar.gz && apk add curl && curl -L $QEMU_URL | tar zxvf - -C . --strip-components 1
#9 sha256:095b3c5cdfca7dd38968bad1941a653baf9c8b9749a24917d3fbe6fbc52441b4
#9 1.879 fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
#9 2.044 fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
#9 2.330 (1/4) Installing ca-certificates (20191127-r4)
#9 2.354 (2/4) Installing nghttp2-libs (1.41.0-r0)
#9 2.377 (3/4) Installing libcurl (7.78.0-r0)
#9 2.377 (4/4) Installing curl (7.78.0-r0)
#9 2.402 Executing busybox-1.31.1-r20.trigger
#9 2.402 Executing ca-certificates-20191127-r4.trigger
#9 2.485 OK: 7 MiB in 18 packages
#9 2.533 % Total % Received % Xferd Average Speed Time Time Time Current
#9 2.533 Dload Upload Total Spent Left Speed
#9 2.533 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 635 100 635 0 0 6388 0 --:--:-- --:--:-- --:--:-- 6414
#9 2.732 0 2009k 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0qemu-5.2.0+balena4-arm/
#9 2.968 100 2009k 100 2009k 0 0 4644k 0 --:--:-- --:--:-- --:--:-- 8661k
#9 2.981 qemu-5.2.0+balena4-arm/qemu-arm-static
#9 DONE 3.1s
#13 [internal] load build context
#13 sha256:2a470ac42133adffde84cf6895e730a79273aba1d488f9dc3db46320a5b5b08b
#13 ...
#10 [stage-1 2/8] COPY --from=builder qemu-arm-static /usr/bin
#10 sha256:0e6ca57875f24facb8a49fc102c494abe6ad819a0ed4969fbb376c136c6abd1e
#10 DONE 0.5s
#13 [internal] load build context
#13 sha256:2a470ac42133adffde84cf6895e730a79273aba1d488f9dc3db46320a5b5b08b
#13 transferring context: 173.99MB 7.4s done
#13 DONE 7.5s
#11 [stage-1 3/8] RUN apk add --update --no-cache nodejs npm yarn
#11 sha256:0503682b4a7b5814dadd92f1cc2aa5d25707bb689c24515c36fee7a915a7a347
#11 1.414 standard_init_linux.go:228: exec user process caused: exec format error
#11 ERROR: executor failed running [/bin/sh -c apk add --update --no-cache nodejs npm yarn]: exit code: 1
------
> [stage-1 3/8] RUN apk add --update --no-cache nodejs npm yarn:
------
error: failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c apk add --update --no-cache nodejs npm yarn]: exit code: 1
Build failed using Buildkit

I will look into it further, your image worked perfectly for me locally, so this is something with Docker Hub. I've been doing it with DH's automated builds, pulled from GH- Any ideas how other containers manage to publish their ARM-based images there? If it's just a case of building it elsewhere and then pushing it to DH, then I think I can write a GH action to handle that, just looking further into it now

Thanks so much for doing that though, it's been super helpful

@evroon
Copy link
Contributor Author

evroon commented Aug 7, 2021

It most likely didn't execute the hook script, I did that as well the first time and got the same error at the same stage (RUN apk add --update --no-cache nodejs npm yarn).

I see now that I made a typo, it should be hooks/pre_build instead of hooks/pre-build. I will change that but if that doesn't work, pushing the image from a GA workflow would be an elegant and simple solution.

@evroon evroon mentioned this pull request Aug 7, 2021
4 tasks
asterling8516 pushed a commit to asterling8516/dashy that referenced this pull request Nov 23, 2023
Closes Lissy93#130

Signed-off-by: Bjorn Lammers <walkxnl@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants