From bba7ce98d04a3ee4b3d936b3e41124a634bdd39f Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Wed, 21 Jul 2021 15:56:33 +0200 Subject: [PATCH] Switched to clang --- Dockerfile | 11 ++++++----- Makefile | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index dd46b46..55305a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,13 +12,13 @@ ARG DI_VER # Install build dependencies # bash: required for dumb-init's Makefile -# gcc, musl-dev: compilation +# clang, build-base: compilation (I just like clang) # curl: downloading the tarballs # hugo: generating the static files RUN apk add --update --no-cache \ bash \ - make \ - gcc \ + build-base \ + clang \ curl \ hugo \ musl-dev @@ -27,7 +27,7 @@ RUN apk add --update --no-cache \ RUN curl -sSL "https://www.acme.com/software/thttpd/thttpd-$THTTPD_VER.tar.gz" | \ tar xzf - && \ cd "thttpd-$THTTPD_VER" && \ - ./configure && \ + CC=clang ./configure && \ make CCOPT="-O3 -s -static" -j$(nproc) # Build dumb-init @@ -35,7 +35,7 @@ RUN curl -sSL "https://www.acme.com/software/thttpd/thttpd-$THTTPD_VER.tar.gz" | RUN curl -sSL "https://github.com/Yelp/dumb-init/archive/refs/tags/v$DI_VER.tar.gz" | \ tar xzf - && \ cd "dumb-init-$DI_VER" && \ - make build + CC=clang make build # =====BUILD BLOG===== @@ -45,6 +45,7 @@ WORKDIR /usr/src/app COPY . ./ # Generate the site +# The find command fixes file permissions, because thttpd thinks executables should be CGI files RUN hugo --minify && \ find public -type f -exec chmod 644 {} \; diff --git a/Makefile b/Makefile index ee5110a..703413e 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ image: publish: @ docker buildx build . \ - --platform linux/amd64,linux/arm64 \ + --platform linux/amd64,linux/arm64,linux/arm/v7 \ -t ${DOCKER_TAG} \ --pull \ --push