Skip to content

Commit

Permalink
Made UPX available for other architechures
Browse files Browse the repository at this point in the history
  • Loading branch information
dermalikmann authored and sebthom committed Apr 16, 2024
1 parent a42e95b commit 24d1361
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ RUN --mount=type=bind,source=.shared,target=/mnt/shared <<EOF
command curl -sSfL --connect-timeout 10 --max-time 30 --retry 3 --retry-all-errors "$@"
}

arch=$(dpkg --print-architecture)
case $arch in
armhf) arch=arm-7 ;;
amd64|arm64) ;;
*) echo "Unsupported arch: $arch"; exit 1;;
esac

echo "#################################################"
echo "Installing required packages..."
echo "#################################################"
Expand All @@ -62,7 +69,7 @@ RUN --mount=type=bind,source=.shared,target=/mnt/shared <<EOF
echo "#################################################"
apt-get install --no-install-recommends -y xz-utils
mkdir /opt/upx
upx_download_url=$(curl "https://api.github.com/repos/upx/upx/releases/latest" | grep browser_download_url | grep amd64_linux.tar.xz | cut "-d\"" -f4)
upx_download_url=$(curl "https://api.github.com/repos/upx/upx/releases/latest" | grep browser_download_url | grep ${arch}_linux.tar.xz | cut "-d\"" -f4)
echo "Downloading [$upx_download_url]..."
curl "$upx_download_url" | tar Jxv -C /opt/upx --strip-components=1
/opt/upx/upx --version
Expand All @@ -73,12 +80,6 @@ RUN --mount=type=bind,source=.shared,target=/mnt/shared <<EOF
echo "#################################################"
echo "Downloading Gitea act runner..."
echo "#################################################"
arch=$(dpkg --print-architecture)
case $arch in
armhf) arch=arm-7 ;;
amd64|arm64) ;;
*) echo "Unsupported arch: $arch"; exit 1;;
esac
if [[ $GITEA_ACT_RUNNER_VERSION == "nightly" ]]; then
act_runner_download_url=https://dl.gitea.com/act_runner/nightly/act_runner-${GITEA_ACT_RUNNER_VERSION}-linux-${arch}
else
Expand Down

0 comments on commit 24d1361

Please sign in to comment.