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

Feat(github-actions): add multi-platform build (raspberry pi support) #245

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kalioz
Copy link

@kalioz kalioz commented Dec 6, 2020

This PR adds to github-action the functionnality to build for multiple platform.
This is currently tested (and working) on amd64 (same as the actual build) and arm/v7 (raspberry pi 4).

I've had to do some workarounds to not lose any functionnality of the current github-action, (e.g. build a first time to test and a second time to actually push as buildx cannot export a multi-platform image to docker yet)

you can see the checks in my repo (kalioz/sftp:master is 1 commit behind this branch as there are some repo-specifics checks that I had to change to make it work on mine) :

I had to lightly change the alpine image as adduser didn't work on the pi (missing c-dependencies, probably due to the use of the "community" repo).

important note for your repo, the registry docker.pkg.github.com is in depreciation (new one is ghcr.io), but I couldn't make this one work... Might cause problems in the future :/

fixes #102

Allow for a more controlled workflow, and should resolve some cache issues
The community repo works fine on the amd64 infra, but not on the arm*
@kalioz
Copy link
Author

kalioz commented Dec 6, 2020

fairly certain the checks are failing because my fork doesn't have access to your repo's secret / github token (which seems wise in terms of security)...
I'd be glad if you could look at it manually @atmoz, if needed I can give you access to my repo (although I made the changes trying to made the changes on this repo as minimal as possible, so nothing should have to be changed here)

@ToMe25
Copy link

ToMe25 commented Dec 28, 2020

Thanks to the builds from this pr i was able to deploy this on a Raspberry Pi cluster.
Thanks for implementing these changes 👍

with:
context: .
file: ./Dockerfile
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be specified as a newline separated list, which is a bit more readable.

platforms: |
  linux/386
  linux/amd64
  linux/arm/v6
  linux/arm/v7
  linux/arm64
  linux/ppc64le
  linux/s390x

with:
context: .
file: ./Dockerfile-alpine
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as previous

@dlehammer
Copy link

Hi @atmoz & @kalioz,

I can confirm the kalioz/sftp:alpine arm-edition works on my Raspberry Pi 4 (arch: arm64) :)

Tested with Docker v20.10.16 and Compose v2.5.0 docker-compose.yml:

version: '3.9'

services:

  sftp:
    container_name: 'sftp'
#    image: 'atmoz/sftp:alpine'
    image: 'kalioz/sftp:alpine'
    ports:
      - '2222:22/tcp'
    volumes:
      - '/data/docker/sftp/ssh_host_ed25519_key:/etc/ssh/ssh_host_ed25519_key:ro'
      - '/data/docker/sftp/ssh_host_rsa_key:/etc/ssh/ssh_host_rsa_key:ro'
      - '/data/docker/sftp/data/users.conf:/etc/sftp/users.conf:ro'
      - '/data/docker/sftp/data/foo:/home/foo/sftp:rw'

What will it take to incorporate this feature ? (besides resolving the current conflicts)

(the atmoz/sftp:alpine (arch: amd64) image results in the dreaded error exec /entrypoint: exec format error on arm64)

with:
context: .
file: ./Dockerfile
platforms: linux/amd64

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be omitted, so it will use underlying runner architecture

@twitnic
Copy link

twitnic commented May 16, 2024

Any news (I ask for arm64)?

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.

Support for arm
6 participants