fix: use prebuilt Dart Sass instead, to avoid using the alpine:edge image [build] (#112)

This commit is contained in:
Razon Yang 2024-12-10 14:03:03 +08:00 committed by GitHub
parent d6afc555a1
commit 796fb87fbc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 24 additions and 15 deletions

View file

@ -37,6 +37,16 @@ RUN --mount=type=cache,target=/go/pkg \
xx-go build -ldflags="$LDFLAGS" -tags $BUILD_TAGS -o /usr/bin/hugo; \
fi
FROM alpine as dart-sass
ARG TARGETARCH
RUN apk add jq curl
RUN curl -s https://api.github.com/repos/sass/dart-sass/releases/latest | \
jq -r --arg REGEXP "^.+-linux-${TARGETARCH/amd64/x64}-musl.tar.gz$" '.assets[].browser_download_url | match($REGEXP) | .string' | \
xargs -n1 curl -L -o dart-sass.tar.gz
RUN tar -C /opt -xzf dart-sass.tar.gz
FROM golang:alpine as builder
COPY --from=gobuild /usr/bin/hugo /usr/bin/hugo

View file

@ -3,7 +3,7 @@ INCLUDE ./Dockerfile-builder
FROM node:alpine AS node
FROM alpine:edge
FROM alpine
INCLUDE ./snippets/node

View file

@ -1,7 +1,7 @@
# syntax = devthefuture/dockerfile-x
INCLUDE ./Dockerfile-builder
FROM alpine:edge
FROM alpine
INCLUDE ./snippets/common

View file

@ -1,7 +1,7 @@
# syntax = devthefuture/dockerfile-x
INCLUDE ./Dockerfile-builder
FROM alpine:edge
FROM alpine
INCLUDE ./snippets/common

View file

@ -1,7 +1,7 @@
# syntax = devthefuture/dockerfile-x
INCLUDE ./Dockerfile-builder
FROM alpine:edge
FROM alpine
INCLUDE ./snippets/common

View file

@ -1,7 +1,7 @@
# syntax = devthefuture/dockerfile-x
INCLUDE ./Dockerfile-builder
FROM alpine:edge
FROM alpine
INCLUDE ./snippets/common

View file

@ -3,7 +3,7 @@ INCLUDE ./Dockerfile-builder
FROM node:alpine AS node
FROM alpine:edge
FROM alpine
INCLUDE ./snippets/node

View file

@ -3,7 +3,7 @@ INCLUDE ./Dockerfile-builder
FROM node:alpine AS node
FROM alpine:edge
FROM alpine
INCLUDE ./snippets/node

View file

@ -10,3 +10,6 @@ RUN gem install html-proofer --bindir /usr/local/bin
# clean up
RUN apk --purge del build-base make ruby-dev
# require by Node.js
RUN apk add --no-cache libstdc++

View file

@ -1,3 +1,2 @@
# install Embedded Dart SASS.
RUN apk add dart-sass --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/
RUN apk add --no-cache dart-sass
COPY --from=dart-sass /opt/dart-sass /opt/dart-sass
ENV PATH="$PATH:/opt/dart-sass"

View file

@ -1,11 +1,8 @@
FROM node:alpine as node
FROM alpine:edge
FROM alpine
COPY --from=node /usr/lib /usr/lib
COPY --from=node /usr/local/lib /usr/local/lib
COPY --from=node /usr/local/include /usr/local/include
COPY --from=node /usr/local/bin /usr/local/bin
INCLUDE ./node
# install extra Markdown handlers
RUN apk add --no-cache \