-
Notifications
You must be signed in to change notification settings - Fork 155
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
Pass arch
value to --platform
#153
base: master
Are you sure you want to change the base?
Conversation
src/run-on-arch.sh
Outdated
|
||
# Defaults | ||
ACTION_DIR="$(cd "$(dirname "$0")"/.. >/dev/null 2>&1 ; pwd -P)" | ||
LOWERCASE_REPOSITORY=$(printf "%s" "$GITHUB_REPOSITORY" | tr '[:upper:]' '[:lower:]') | ||
PACKAGE_REGISTRY="ghcr.io/${LOWERCASE_REPOSITORY}/${CONTAINER_NAME}" | ||
DEBIAN_FRONTEND=noninteractive | ||
|
||
# Sanitize inputs | ||
if [[ "$ARCH" == "none" ]]; then | ||
unset ARCH |
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.
unset ARCH | |
export ARCH=amd64 |
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.
I was thinking if we should allow an interface to not pass --platform
, that was the reason for unset
approach
src/run-on-arch.sh
Outdated
@@ -49,6 +55,7 @@ build_container () { | |||
then | |||
docker build \ | |||
"${ACTION_DIR}/Dockerfiles" \ | |||
${ARCH:+--platform=linux/$ARCH} \ |
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.
${ARCH:+--platform=linux/$ARCH} \ | |
--platform=linux/$ARCH \ |
src/run-on-arch.sh
Outdated
@@ -70,6 +77,7 @@ build_container () { | |||
docker pull "$PACKAGE_REGISTRY:latest" || true | |||
docker build \ | |||
"${ACTION_DIR}/Dockerfiles" \ | |||
${ARCH:+--platform=linux/$ARCH} \ |
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.
${ARCH:+--platform=linux/$ARCH} \ | |
--platform=linux/$ARCH \ |
One other thing I should ask. I was able to debug locally with Edit: I've tried adding it to |
7c5be02
to
919d47a
Compare
@@ -49,6 +55,7 @@ build_container () { | |||
then | |||
docker build \ |
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.
Probably it will be a good idea to start using buildx
instead
This comes from a debugging session in #152. It seems to resolve issues like: