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

Enable Arm64 images with qemu #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Jingzhao123
Copy link

Enable Arm64 images with qemu

Signed-off-by: Jingzhao Ni Jingzhao.Ni@arm.com

Enable Arm64 images with qemu

Signed-off-by: Jingzhao Ni <Jingzhao.Ni@arm.com>
@Jingzhao123
Copy link
Author

@sgerrand

@sgerrand
Copy link
Owner

Enable Arm64 images

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?

@Jingzhao123
Copy link
Author

Enable Arm64 images

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,
In this patch, I think I have updated the circleCI script to verifiy my modification. Is circleCI used for verifying?
In addition, I want to build the glibc arm64 binary packages. So I update some builder images which are used for alpine-pkg-glibc. Do you have any suggestion about it?

@sgerrand
Copy link
Owner

👋 I will try to review these changes tonight.

@Jingzhao123
Copy link
Author

Hi, any comments?

Copy link
Owner

@sgerrand sgerrand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙋 The two Alpine versions don't match. Was this intentional?

ARG QEMUVERSION=4.0.0
ARG QEMUARCH

SHELL ["/bin/ash", "-o", "pipefail", "-c"]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙋 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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙋 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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙋 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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per the previous comment.

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

Successfully merging this pull request may close these issues.

None yet

2 participants