Skip to content

Commit

Permalink
switch from dart-sass-embedded to dart-sass (#181)
Browse files Browse the repository at this point in the history
This should fix the sass version and also will update the already
present dart-sass-embedded version - #178
  • Loading branch information
floryn90 authored Nov 30, 2024
2 parents b13d6ba + 0b9a12c commit 52bda4f
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 46 deletions.
2 changes: 1 addition & 1 deletion src/docker/_base/_main.df
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ IMPORT nodejs AS nodejs

IMPORT pandoc AS pandoc

IMPORT sass-embedded AS sass-embedded
IMPORT sass AS sass

IMPORT files AS files

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ FROM base--image--alpine AS fetcher

ARG TARGETPLATFORM

ADD _script/sass-embedded.sh sass-embedded.sh
RUN sh sass-embedded.sh
ADD _script/sass.sh sass.sh
RUN sh sass.sh



Expand Down
2 changes: 1 addition & 1 deletion src/docker/_imports/default_nonroot_user.df
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

# Create a custom user with UID 1234 and GID 1234
RUN getent group hugo 2>&1 > /dev/null || groupadd -g 1234 hugo && \
getent passwd hugo 2>&1 > /dev/null || useradd -m -u 1234 -g hugo hugo
getent passwd hugo 2>&1 > /dev/null || useradd -m -u 1234 -g hugo hugo
2 changes: 1 addition & 1 deletion src/docker/_imports/default_nonroot_user_alpine.df
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
RUN getent group hugo 2>&1 > /dev/null || addgroup -g 1234 hugo \
&& getent passwd hugo 2>&1 > /dev/null || adduser -u 1234 -D -H -G hugo -g "" hugo
&& getent passwd hugo 2>&1 > /dev/null || adduser -u 1234 -D -H -G hugo -g "" hugo
2 changes: 1 addition & 1 deletion src/docker/alpine-ext/ext-alpine.df
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ENV HUGO_BIND="0.0.0.0" \
NODE_PATH=".:/usr/local/lib/node_modules:/usr/local/node/lib/node_modules" \
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/node/bin" \
GOROOT="/usr/local/lib/go" \
HOME="/tmp"
HOME="/home/hugo"

USER root

Expand Down
2 changes: 1 addition & 1 deletion src/docker/alpine/alpine.df
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ IMPORT ../_imports/version_arg
ENV HUGO_BIND="0.0.0.0" \
HUGO_DESTINATION="public" \
HUGO_ENV="DEV" \
HOME="/tmp"
HOME="/home/hugo"

COPY --from=image / /
USER root
Expand Down
2 changes: 1 addition & 1 deletion src/docker/busybox/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ENV HUGO_BIND="0.0.0.0" \
HUGO_DESTINATION="public" \
HUGO_ENV="DEV" \
HUGO_EDITION="standard" \
HOME="/tmp"
HOME="/home/hugo"

COPY --from=image / /

Expand Down
2 changes: 1 addition & 1 deletion src/docker/debian-ext/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM scratch as image

COPY --from=base--hugo--extended / /
COPY --from=base--pandoc / /
COPY --from=base--sass-embedded / /
COPY --from=base--sass / /
#COPY --from=base--nodejs--glibc / /


Expand Down
2 changes: 1 addition & 1 deletion src/docker/debian/base.df
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ IMPORT ../_imports/version_arg
ENV HUGO_BIND="0.0.0.0" \
HUGO_DESTINATION="public" \
HUGO_ENV="DEV" \
HOME="/tmp"
HOME="/home/hugo"
USER root
IMPORT ../_imports/default_nonroot_user.df

Expand Down
6 changes: 3 additions & 3 deletions src/docker/ubuntu-ext/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM scratch as image

COPY --from=base--hugo--extended / /
COPY --from=base--pandoc / /
COPY --from=base--sass-embedded / /
COPY --from=base--sass / /
#COPY --from=base--nodejs--glibc / /


Expand Down Expand Up @@ -60,8 +60,8 @@ RUN true \
&& chmod a+wrx /src /target \
#
# add /src to safe.directory
&& git config --global --add safe.directory /src

&& git config --global --add safe.directory /src
COPY --from=base--golang / /

VOLUME [ "/src", "/target" ]
Expand Down
2 changes: 1 addition & 1 deletion src/docker/ubuntu/base.df
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ IMPORT ../_imports/version_arg
ENV HUGO_BIND="0.0.0.0" \
HUGO_DESTINATION="public" \
HUGO_ENV="DEV" \
HOME="/tmp"
HOME="/home/hugo"

COPY --from=base--files--ubuntu / /

Expand Down
32 changes: 0 additions & 32 deletions src/files/_script/sass-embedded.sh

This file was deleted.

40 changes: 40 additions & 0 deletions src/files/_script/sass.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/sh

# This file is triggered inside the _base/Dockerfile-base file.

set -e
set -u

# Variables
SASS_VERSION="1.81.0"

# Architecture
TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}

if [ "$TARGETPLATFORM" = "linux/amd64" ]; then
ARCH="x64"
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then
ARCH="arm64"
else
echo "Unknown build architecture: $TARGETPLATFORM"
exit 2
fi

# Download
wget https://github.com/sass/dart-sass/releases/download/${SASS_VERSION}/dart-sass-${SASS_VERSION}-linux-${ARCH}.tar.gz \
-O /sass.tar.gz

# Unpack
mkdir -p /files/usr/local/lib /files/usr/local/bin
tar -zxvf sass.tar.gz -C /files/usr/local/lib

# Create symlink
ln -s /usr/local/lib/dart-sass/sass /files/usr/local/bin/sass

# Create alias for saas --embedded
mkdir -p /files/etc/profile.d /files/home/hugo
echo 'alias dart-sass-embedded="sass --embedded"' > /files/etc/profile.d/dart-sass-embedded.sh
echo 'alias dart-sass-embedded="sass --embedded"' > /files/home/hugo/.bash_aliases

# Make script executable
chmod a+x /files/etc/profile.d/dart-sass-embedded.sh

0 comments on commit 52bda4f

Please sign in to comment.