Created
October 19, 2020 08:25
-
-
Save hongkongkiwi/48338255bde9f3f4160f6cd532bc89bc to your computer and use it in GitHub Desktop.
Dockerfile snippet to detect platform arch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:latest | |
ARG PLATFORM_ARCH= | |
RUN case "$(uname -m)" in \ | |
x86_32) export PLATFORM_ARCH='386' ;; \ | |
x86_64) export PLATFORM_ARCH='amd64' ;; \ | |
amd64) export PLATFORM_ARCH='amd64' ;; \ | |
armhf) export PLATFORM_ARCH='arm' ;; \ | |
armv7) export PLATFORM_ARCH='arm' ;; \ | |
aarch64) export PLATFORM_ARCH='arm64' ;; \ | |
arm64) export PLATFORM_ARCH='arm64' ;; \ | |
*) echo >&2 "error: unsupported architecture ($PLATFORM_ARCH)"; exit 1 ;; \ | |
esac; \ | |
echo "Detected System Architecture \"$PLATFORM_ARCH\"" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment