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

Docker Images for arm64 releases (Raspberry Pi) #1512

Closed
shalzz opened this issue Aug 12, 2020 · 6 comments
Closed

Docker Images for arm64 releases (Raspberry Pi) #1512

shalzz opened this issue Aug 12, 2020 · 6 comments
Assignees
Labels
A0 enhancement New feature or request infra-ci

Comments

@shalzz
Copy link

shalzz commented Aug 12, 2020

Description

Hello,
Please also consider providing Docker Image releases for arm64/aarch64 platforms along with amd64 Docker Images on Docker Hub.

@paulhauner
Copy link
Member

Good idea. Seems like dockerhub doesn't support it natively but we can do it via Github Actions: https://www.henry.wang/2019/12/05/arm-dockerhub.html

I don't have bandwidth for this at the moment, but I think it's worth doing.

@paulhauner paulhauner added enhancement New feature or request low-hanging-fruit Easy to resolve, get it before someone else does! labels Aug 17, 2020
@paulhauner
Copy link
Member

Marked as low-hanging-fruit since it's a relatively simple way to make a material difference to users.

@paulhauner
Copy link
Member

@realbigsean this might interest you :)

@realbigsean realbigsean self-assigned this Aug 26, 2020
bors bot pushed a commit that referenced this issue Sep 3, 2020
## Issue Addressed

#1512

## Proposed Changes

Use Github Actions to automate the Docker image build, so that we can make a multi-arch image.  

## Additional Info

This change will require adding the DOCKER_USERNAME and DOCKER_PASSWORD secrets in Github. It will also require disabling the Docker Hub automated build.
bors bot pushed a commit that referenced this issue Sep 4, 2020
## Issue Addressed

#1512

## Proposed Changes

Use Github Actions to automate the Docker image build, so that we can make a multi-arch image.  

## Additional Info

This change will require adding the DOCKER_USERNAME and DOCKER_PASSWORD secrets in Github. It will also require disabling the Docker Hub automated build.
darcys22 pushed a commit to darcys22/lighthouse that referenced this issue Sep 5, 2020
## Issue Addressed

sigp#1512

## Proposed Changes

Use Github Actions to automate the Docker image build, so that we can make a multi-arch image.  

## Additional Info

This change will require adding the DOCKER_USERNAME and DOCKER_PASSWORD secrets in Github. It will also require disabling the Docker Hub automated build.
@ghost ghost added A1 infra-ci labels Sep 9, 2020
@realbigsean
Copy link
Member

A few notes on making a multi-arch image:

  • it's not doable using Dockerhub atm, but it is in their roadmap. I also tried using a workaround using emulation, but their build servers are too old.
  • it's doable using github actions and QEMU, but takes a looooong time (~5 hours). I also went down the rabbit hole of trying to use cross-compilation to speed things up, but cross uses docker, so you end up needing to start a docker container within a docker build which gets hairy. (I think cross also uses QEMU so I don't know whether it'll speed stuff up)
  • I think the solution that's the most straightforward and likely to result in the fastest builds is to run a docker builder node on an ARM64 and one on an AMD64 server and coordinate them

@michaelsproul
Copy link
Member

cross uses docker, so you end up needing to start a docker container within a docker build which gets hairy. (I think cross also uses QEMU so I don't know whether it'll speed stuff up)

Building an ARM binary with cross doesn't use QEMU, and is quite fast. I think we could do something like:

  1. Build ARM binary using cross, on "bare metal" (no nested Docker, but probably under a hypervisor)
  2. Copy that binary into a base image as we currently do in the 2nd stage of our build:

lighthouse/Dockerfile

Lines 9 to 16 in c6baa0e

FROM debian:buster-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
libssl-dev \
ca-certificates \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local/cargo/bin/lighthouse /usr/local/bin/lighthouse
COPY --from=builder /usr/local/cargo/bin/lcli /usr/local/bin/lcli

@realbigsean
Copy link
Member

@michaelsproul I got something working in #2065 using cross first like you suggested and then docker buildx to cross-build the docker image, and then docker manifest to make the multi-arch image. Let me know your thoughts

It's way faster 🔥

@michaelsproul michaelsproul removed the low-hanging-fruit Easy to resolve, get it before someone else does! label Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A0 enhancement New feature or request infra-ci
Projects
None yet
Development

No branches or pull requests

4 participants