Open pfremm opened 4 years ago
Yes, that's an interesting suggestion! I will look into this later. Thanks!
I got this working on a fork: https://github.com/pfremm/transmission-rss/blob/master/.github/workflows/main.yml
This creates a 49MB image that runs on my Raspberry Pi 3B+ Cross built on AMD64
DockerfileCrossCompile.arm7hf
FROM balenalib/armv7hf-alpine:3.11 as builder
RUN [ "cross-build-start" ]
RUN apk add gcc libc-dev make ruby-dev
RUN gem install --build-root /build transmission-rss
RUN [ "cross-build-end" ]
###
FROM balenalib/armv7hf-alpine:3.11
RUN [ "cross-build-start" ]
RUN apk add --no-cache ruby ruby-etc ruby-json
RUN [ "cross-build-end" ]
COPY --from=builder /build /
CMD ["transmission-rss"]
I needed aarch64. Buildx is really a easier in my opinion for multi architecture
Let's keep this open. I want to configure the Travis CI build to also generate arm64 images or migrate to GitHub Actions in the future.
After setting up buildx (I hadn't heard of it before) I agree it's the better way to go. Although it is not 'production' ready per Docker Inc, or as easy to get going as using the Balena crossbuild images. This is nice because you can use one Dockerfile for all platforms and use one build command to build for many platforms at once. Depending on the backend it can do parallel build on multiple machines.
To the above Dockerfile (using official Alpine image) I had to add libgcc
package in the final stage to the apk list. The resultant image is 21.9MB for armhf
A side note for Docker image sizes: Creating Smaller Docker Images - Ian Lewis
I noticed no arm based docker builds exist for pis or other SBC boards? Is that something you are willing to do? Appears you could use a github action with buildx.