From ad39fb995226ea952146539db45c45b7e3642759 Mon Sep 17 00:00:00 2001 From: James McDonald Date: Wed, 4 Jan 2023 00:06:24 +0000 Subject: [PATCH] Update docker build to support M1 Mac --- .dockerignore | 1 - Dockerfile | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) delete mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 6b8710a..0000000 --- a/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -.git diff --git a/Dockerfile b/Dockerfile index 7b465dd..e9885dc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,11 @@ FROM debian AS builder RUN apt-get update \ - && apt-get install -y curl jq \ - && URL=$(curl -sS -H 'Accept: appliction/vnd.github.v3+json' https://api.github.com/repos/gohugoio/hugo/releases/latest | jq -r '.assets[] | select(.name | test("hugo_[^e].*Linux-64bit.tar.gz")) | .browser_download_url') \ + && apt-get install -y curl jq git \ + && ARCH=$(uname -m | sed -e 's/x86_/amd/' -e 's/aarch/arm/') \ + && echo ">>> ARCH $ARCH" \ + && URL=$(curl -sS -H 'Accept: appliction/vnd.github.v3+json' https://api.github.com/repos/gohugoio/hugo/releases/latest | jq -r '.assets[] | select(.name | test("hugo_[^e].*linux-'$ARCH'.tar.gz")) | .browser_download_url') \ + && echo ">>> URL $URL" \ && curl -sSL -o hugo.tar.gz $URL \ && tar -C /usr/local/bin -xf hugo.tar.gz hugo