From f46e00fa4c6d72d4cc87c9a817d83b2f35161e8f Mon Sep 17 00:00:00 2001 From: binhex Date: Tue, 19 Sep 2023 11:37:23 +0100 Subject: [PATCH] add in targetarch --- Dockerfile | 4 +++- build/root/install.sh | 22 +++------------------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index c9ca77f..830d351 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,8 @@ FROM binhex/arch-int-vpn:latest LABEL org.opencontainers.image.authors = "binhex" LABEL org.opencontainers.image.source = "https://github.com/binhex/arch-qbittorrentvpn" +ARG TARGETARCH + # additional files ################## @@ -25,7 +27,7 @@ ADD config/nobody/ /home/nobody/ # make executable and run bash scripts to install app RUN chmod +x /root/*.sh /home/nobody/*.sh && \ - /bin/bash /root/install.sh "${release_tag_name}" + /bin/bash /root/install.sh "${release_tag_name}" "${TARGETARCH}" # docker settings ################# diff --git a/build/root/install.sh b/build/root/install.sh index 1c3a03b..09fb971 100644 --- a/build/root/install.sh +++ b/build/root/install.sh @@ -8,30 +8,14 @@ release_tag_name="${1//-[0-9][0-9]/}" # note do NOT download build scripts - inherited from int script with envvars common defined -# detect image arch -#### - -OS_ARCH=$(cat /etc/os-release | grep -P -o -m 1 "(?=^ID\=).*" | grep -P -o -m 1 "[a-z]+$") -if [[ ! -z "${OS_ARCH}" ]]; then - if [[ "${OS_ARCH}" == "arch" ]]; then - OS_ARCH="x86-64" - else - OS_ARCH="aarch64" - fi - echo "[info] OS_ARCH defined as '${OS_ARCH}'" -else - echo "[warn] Unable to identify OS_ARCH, defaulting to 'x86-64'" - OS_ARCH="x86-64" -fi +# get target arch from Dockerfile argument +TARGETARCH="${2}" # pacman packages #### -# hack - needs rsync for reflector -pacman -S rsync --noconfirm - # call pacman db and package updater script -source upd.sh +source upd.sh "${TARGETARCH}" # define pacman packages pacman_packages="qbittorrent-nox python geoip"