From 0b59f273a2535d14304565f9ea586a1da289f596 Mon Sep 17 00:00:00 2001 From: maotovisk Date: Sat, 9 Aug 2025 02:37:36 -0300 Subject: [PATCH] fix(dockerfile): use correct arch on tailwind css download --- Dockerfile | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index de39d77..5eaee99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,9 +25,21 @@ RUN set -eux; \ go install "github.com/a-h/templ/cmd/templ@${TEMPL_VER}" # ---- Tailwind v4 standalone ---- -RUN curl -fsSL -o /usr/local/bin/tailwindcss \ - "https://github.com/tailwindlabs/tailwindcss/releases/download/${TAILWIND_VERSION}/tailwindcss-linux-x64-musl" \ - && chmod +x /usr/local/bin/tailwindcss +RUN set -eux; \ + ARCH="$(uname -m)"; \ + case "${ARCH}" in \ + x86_64) TAILWIND_ARCH="x64" ;; \ + aarch64) TAILWIND_ARCH="arm64" ;; \ + *) echo "Unsupported architecture: ${ARCH}" && exit 1 ;; \ + esac; \ + TAILWIND_URL="https://github.com/tailwindlabs/tailwindcss/releases/download/${TAILWIND_VERSION}/tailwindcss-linux-${TAILWIND_ARCH}-musl"; \ + echo "Downloading Tailwind CSS for ${ARCH} from ${TAILWIND_URL}"; \ + curl -fsSL -o /usr/local/bin/tailwindcss "${TAILWIND_URL}"; \ + # Verify the download is a valid ELF binary \ + file /usr/local/bin/tailwindcss | grep -q "ELF.*executable" || (echo "Downloaded file is not a valid ELF binary:" && file /usr/local/bin/tailwindcss && exit 1); \ + chmod +x /usr/local/bin/tailwindcss; \ + # Test that the binary works \ + /usr/local/bin/tailwindcss --version # App source COPY . .