Feat(github-actions): add multi-platform build (raspberry pi support)
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) :
- github : https://github.com/kalioz/sftp
- last action succesful : https://github.com/kalioz/sftp/runs/1507309955
- dockerhub : https://hub.docker.com/r/kalioz/sftp/tags
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 https://github.com/atmoz/sftp/issues/102
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)
Thanks to the builds from this pr i was able to deploy this on a Raspberry Pi cluster. Thanks for implementing these changes :+1:
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)