Conversation
Enable Arm64 images with qemu Signed-off-by: Jingzhao Ni <Jingzhao.Ni@arm.com>
What kind of images are you proposing to build? Can the existing test suite be extended to validate that these changes enable that to happen? |
Hi, Sgerrand, |
|
👋 I will try to review these changes tonight. |
|
Hi, any comments? |
sgerrand
left a comment
There was a problem hiding this comment.
Thanks for submitting this proposal. The Docker images for this repository are currently being automatically built on Docker Hub, so any change to support ARM (64 bit or otherwise) will require reconfiguring the way that images are built, tagged and pushed.
The changes here are not ready to be merged and used as is, but I'd like to cherry pick some of the ideas you've provided in order to provide an ARM based image for people who'd like to build Alpine Linux packages for that architecture.
Thanks again!
| RUN curl -fsSL https://github.com/multiarch/qemu-user-static/releases/download/v${QEMUVERSION}/qemu-${QEMUARCH}-static.tar.gz | tar zxvf - -C /usr/bin | ||
| RUN chmod +x /usr/bin/qemu-* | ||
|
|
||
| FROM ${IMAGEARCH}alpine:3.11 |
There was a problem hiding this comment.
🙋 The two Alpine versions don't match. Was this intentional?
| ARG QEMUVERSION=4.0.0 | ||
| ARG QEMUARCH | ||
|
|
||
| SHELL ["/bin/ash", "-o", "pipefail", "-c"] |
There was a problem hiding this comment.
🙋 Is it necessary to change the default shell options? You could break the curl | tar command into separate RUN steps and the resulting build would be easier to debug (e.g. if there were issues with a network connection to https://github.com).
| ARG IMAGEARCH | ||
| FROM alpine:3.12 as qemu | ||
| RUN apk add --no-cache curl | ||
| ARG QEMUVERSION=4.0.0 |
There was a problem hiding this comment.
🙋 This version of QEMU for multiple architectures is over a year old now. Could a more recent version be used instead? Even the v4.0.x series has had v4.0.0-4 released subsequently.
| # Build x86 images | ||
| docker build --build-arg IMAGEARCH= \ | ||
| --build-arg QEMUARCH="x86_64" \ | ||
| --file Dockerfile --tag sgerrand/alpine-abuilder:amd64 . --pull |
There was a problem hiding this comment.
🙋 The images for this project are currently tagged by Alpine version. I'd prefer to keep that prefix in front of any architecture related tag, such as amd64.
| # Build arm64 image | ||
| docker build --build-arg IMAGEARCH="arm64v8/" \ | ||
| --build-arg QEMUARCH="aarch64" \ | ||
| --file Dockerfile --tag sgerrand/alpine-abuilder:arm64 . --pull |
Enable Arm64 images with qemu
Signed-off-by: Jingzhao Ni Jingzhao.Ni@arm.com