-
Notifications
You must be signed in to change notification settings - Fork 157
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
feat(qemu_static_image): add qemu_static_image option #104
base: master
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 |
---|---|---|
|
@@ -5,8 +5,10 @@ set -euo pipefail | |
# Args | ||
DOCKERFILE=$1 | ||
CONTAINER_NAME=$2 | ||
QEMU_STATIC_CONTAINER=$3 | ||
|
||
# Remainder of args get passed to docker | ||
declare -a DOCKER_RUN_ARGS=${@:3:${#@}} | ||
declare -a DOCKER_RUN_ARGS=${@:4:${#@}} | ||
|
||
# Defaults | ||
ACTION_DIR="$(cd "$(dirname "$0")"/.. >/dev/null 2>&1 ; pwd -P)" | ||
|
@@ -35,9 +37,7 @@ install_deps () { | |
# Install support for non-x86 emulation in Docker via QEMU. | ||
# Platforms: linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, | ||
# linux/386, linux/arm/v7, linux/arm/v6 | ||
sudo apt-get update -q -y | ||
sudo apt-get -qq install -y qemu qemu-user-static | ||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes --credential yes | ||
docker run --rm --privileged $QEMU_STATIC_CONTAINER --reset -p yes --credential yes | ||
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. I think this answers my earlier question. It won't work with QUS because it uses different options' names (https://dbhi.github.io/qus/tests.html) 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. Yeah, currently I think we can only use multiarch/qemu-user-static compatible images. |
||
} | ||
|
||
build_container () { | ||
|
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.
Would that work with aptman/qus (https://dbhi.github.io/qus/) ?
AFAIK QUS is also still on QEMU 7.1 but I wonder how generic this new setting is - does it support any qemu-user-static provider or just forks of multiarch/qemu-user-static.
One thing I like better in QUS is that it works on other platforms too, e.g. you can emulate x86_64 on aarch64 machine.
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.
For now, I have tested with my own fork of multiarch/qemu-user-static, which can be used from longhronshens/qemu-user-static:latest. This fork has been updated to use qemu 7.2. As for aptman/qus, this is more complicated than what run-on-arch-action does. That is not very good for simple cases. This is why I'd rather to use run-on-arch-action.
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.
As for emulating x86_64 on aarch64 machine, I think my fork can also be used like that, since I have pushed qemu-user-static:latest with multiple architectures. But since uraimo/run-on-arch-action can only be used on GitHub Action runner which runs on x86_64 by default, multi-arch support is somewhat meaningless.