From 0306f08709ff3916705bcab240b88fa53fda1648 Mon Sep 17 00:00:00 2001 From: nerethos Date: Sat, 23 Nov 2024 16:46:46 +0000 Subject: [PATCH] Improved Dockerfile Added a script that determines the arch used for building and downloads the correct release from Github. --- Dockerfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 529996f..e8480b2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,16 @@ WORKDIR /usr/src/app RUN apk --no-cache add curl jq RUN latest_release=$(curl --silent "https://api.github.com/repos/donetick/donetick/releases/latest" | jq -r .tag_name) && \ -curl -fL "https://github.com/donetick/donetick/releases/download/${latest_release}/donetick_Linux_x86_64.tar.gz" | tar -xz -C . + set -ex; \ + apkArch="$(apk --print-arch)"; \ + case "$apkArch" in \ + armhf) arch='armv6' ;; \ + armv7) arch='armv7' ;; \ + aarch64) arch='arm64' ;; \ + x86_64) arch='x86_64' ;; \ + *) echo >&2 "error: unsupported architecture: $apkArch"; exit 1 ;; \ + esac; \ + curl -fL "https://github.com/donetick/donetick/releases/download/${latest_release}/donetick_Linux_$arch.tar.gz" | tar -xz -C . # Stage 2: Create a smaller runtime image FROM alpine:latest