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

Alpine for ARM #237

Closed
zyfdegh opened this issue Dec 21, 2016 · 7 comments
Closed

Alpine for ARM #237

zyfdegh opened this issue Dec 21, 2016 · 7 comments

Comments

@zyfdegh
Copy link

zyfdegh commented Dec 21, 2016

I'm using alpine:latest as base image, and run container on Raspberry Pi 2(armv7l). But error occured when trying to shell into container,

$ sudo docker exec -it myalpine sh
exec format error

it's due to /bin/sh is built for Linux x86_64 I guess.

So, any idea on supporting alpine for ARM?

@justincormack
Copy link

There is a docker hub image at armhf/alpine.

@jrmoserbaltimore
Copy link

It would be nice if the hub supported multi-arch registries. I made some comments in that direction, but nothing close to filing a bug yet.

Ideally, something like the below would allow an armhf and x86_64 architecture to both build from the same Dockerfile, in some imaginary future version of the Docker registry:

FROM scratch
ENV ALPINE_VERSION 3.5.0
ADD alpine-minirootfs-${ALPINE_VERSION}-${DOCKER_ARCH}.tar.gz /

Right now, the Hub only knows images by name and tag--it doesn't know about architecture--so no such thing will work, unfortunately.

@andyshinn
Copy link
Contributor

I'll leave this open for now. But I think the limitations have already been mentioned before:

  • Docker Hub (and other registries as far as I know) don't provide a way to distinguish architecture for a single repository (though, we could just as well have a special tag for arm).
  • There aren't any arm builders for either Docker Hub or CircleCI. We'd need some way to automate the building of arm images.

@alexkreidler
Copy link
Contributor

+1 for official alpine image multi-arch support.

Debian and Ubuntu both already have this.

@alexkreidler
Copy link
Contributor

Docker Hub provides a system for official docker-library maintainers to distribute multi-arch images. When we submit an update to the docker-library repo, we can specify alternate architectures which will then get pushed to the appropriate organization on Docker Hub.

See https://github.com/docker-library/official-images#multiple-architectures

For example, the debian image specifies multiple architectures in this file, which then get pushed to the docker hub organizations amd64, armv7, armv5, i386, etc

The amd64 organization on Docker Hub is effectively the same as the regular library org, which is why Alpine is currently in both.

@alexkreidler
Copy link
Contributor

As far as actually building the images, all you need to do is change the --arch flag on apk fetch alpine-base to the arch you are building. See builder/scripts/mkimage-alpine.bash

Since we're not actually compiling anything, just downloading some files, it seems fairly simple to add multi-arch to the build proccess, if I'm not mistaken. I think this should also work on any builder architecture (even an x86_64 based CircleCI or Docker Hub builder).

The last step would be to change the library spec file generator here to include the architectures we support.

@andyshinn If this sounds good to you, I'll start working on a PR

The last decision would probably be whether the gliderlabs images would want multiarch. This would probably be more complicated because there isn't a great place to put them.

This was referenced Aug 15, 2017
@andyshinn
Copy link
Contributor

We've completed the first release for multi-arch alpine. See #352.

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

5 participants