-
Notifications
You must be signed in to change notification settings - Fork 11
Enable Arm64 images with qemu #5
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,4 +8,4 @@ jobs: | |
| - setup_remote_docker | ||
| - run: | ||
| name: Build Docker image | ||
| command: docker build . --pull | ||
| command: ./build.sh | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,19 @@ | ||
| FROM alpine:3.11 | ||
| #Add qemu function for supporting multiarch | ||
| ARG IMAGEARCH | ||
| FROM alpine:3.12 as qemu | ||
| RUN apk add --no-cache curl | ||
| ARG QEMUVERSION=4.0.0 | ||
| ARG QEMUARCH | ||
|
|
||
| SHELL ["/bin/ash", "-o", "pipefail", "-c"] | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
|
||
| 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 | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🙋 The two Alpine versions don't match. Was this intentional? |
||
| ARG QEMUARCH | ||
| COPY --from=qemu /usr/bin/qemu-${QEMUARCH}-static /usr/bin/ | ||
|
|
||
| RUN apk --no-cache add alpine-sdk coreutils cmake \ | ||
| && adduser -G abuild -g "Alpine Package Builder" -s /bin/ash -D builder \ | ||
| && echo "builder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #!/bin/sh | ||
| set -e | ||
|
|
||
| export DOCKER_CLI_EXPERIMENTAL=enabled | ||
| docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | ||
|
|
||
| # Build x86 images | ||
| docker build --build-arg IMAGEARCH= \ | ||
| --build-arg QEMUARCH="x86_64" \ | ||
| --file Dockerfile --tag sgerrand/alpine-abuilder:amd64 . --pull | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| # Build arm64 image | ||
| docker build --build-arg IMAGEARCH="arm64v8/" \ | ||
| --build-arg QEMUARCH="aarch64" \ | ||
| --file Dockerfile --tag sgerrand/alpine-abuilder:arm64 . --pull | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As per the previous comment. |
||
There was a problem hiding this comment.
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.