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

arm based docker images? #96

Open
pfremm opened this issue Feb 17, 2020 · 7 comments
Open

arm based docker images? #96

pfremm opened this issue Feb 17, 2020 · 7 comments

Comments

@pfremm
Copy link

pfremm commented Feb 17, 2020

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.

@nning
Copy link
Owner

nning commented Feb 18, 2020

Yes, that's an interesting suggestion! I will look into this later. Thanks!

@pfremm
Copy link
Author

pfremm commented Feb 18, 2020

@sedlund
Copy link

sedlund commented Mar 21, 2020

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"]

@pfremm
Copy link
Author

pfremm commented Mar 21, 2020

I needed aarch64. Buildx is really a easier in my opinion for multi architecture

@pfremm pfremm closed this as completed Mar 21, 2020
@nning
Copy link
Owner

nning commented Mar 21, 2020

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.

@nning nning reopened this Mar 21, 2020
@sedlund
Copy link

sedlund commented Mar 22, 2020

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

@marazmarci
Copy link

A side note for Docker image sizes: Creating Smaller Docker Images - Ian Lewis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants