2021-07-28 22:33:16 -06:00
|
|
|
#
|
2021-07-29 00:00:52 -06:00
|
|
|
# Dart-SASS compiler on Debian-Slim
|
2021-07-28 22:33:16 -06:00
|
|
|
#
|
|
|
|
|
2022-02-26 22:58:59 -07:00
|
|
|
ARG DEBIAN_VERSION=bullseye-slim
|
2021-07-29 00:00:52 -06:00
|
|
|
FROM debian:${DEBIAN_VERSION}
|
|
|
|
ARG DEBIAN_VERSION
|
2022-02-26 22:58:59 -07:00
|
|
|
ARG SASS_VERSION=1.49.9
|
2021-07-28 22:33:16 -06:00
|
|
|
|
|
|
|
# create a limited user to run sass
|
|
|
|
ARG SASS_UID=8101
|
|
|
|
ARG SASS_GID=8101
|
2021-07-29 00:00:52 -06:00
|
|
|
RUN addgroup --system --gid ${SASS_GID} sass \
|
|
|
|
&& adduser \
|
|
|
|
--system \
|
|
|
|
--uid ${SASS_UID} \
|
|
|
|
--ingroup sass \
|
|
|
|
--disabled-password \
|
|
|
|
--no-create-home \
|
|
|
|
--gecos 'sass system user' \
|
|
|
|
sass \
|
|
|
|
&& mkdir /sass /css \
|
|
|
|
&& chown -R sass:sass /sass /css
|
2021-07-28 22:33:16 -06:00
|
|
|
|
|
|
|
# download dart-sass, tini and timezone support, update all packages
|
2021-07-29 00:00:52 -06:00
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get install -y \
|
2021-07-28 22:33:16 -06:00
|
|
|
tini \
|
|
|
|
tzdata \
|
2021-07-29 00:00:52 -06:00
|
|
|
wget \
|
|
|
|
&& apt-get upgrade \
|
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
2021-07-28 22:33:16 -06:00
|
|
|
&& wget https://github.com/sass/dart-sass/releases/download/${SASS_VERSION}/dart-sass-${SASS_VERSION}-linux-x64.tar.gz \
|
|
|
|
-O /tmp/dart-sass-${SASS_VERSION}.tar.gz \
|
2021-07-29 00:00:52 -06:00
|
|
|
&& tar -zxvf /tmp/dart-sass-${SASS_VERSION}.tar.gz -C /opt/ \
|
|
|
|
&& rm -f /tmp/dart-sass-${SASS_VERSION}.tar.gz \
|
|
|
|
&& chmod +x /opt/dart-sass/sass
|
2021-07-28 22:33:16 -06:00
|
|
|
|
|
|
|
# labels
|
|
|
|
MAINTAINER Asif Bacchus <asif@asifbacchus.dev>
|
|
|
|
LABEL maintainer="Asif Bacchus <asif@asifbacchus.dev>"
|
|
|
|
LABEL dev.asifbacchus.docker.internalName="ab-dart-sass"
|
|
|
|
LABEL org.opencontainers.image.authors="Asif Bacchus <asif@asifbacchus.dev>"
|
2021-07-29 00:00:52 -06:00
|
|
|
LABEL org.opencontainers.image.description="Dockerized implementation of Dart-SASS compiler running on Debian (slim) using a limited account."
|
2021-08-03 18:22:40 -06:00
|
|
|
LABEL org.opencontainers.image.documentation="https://git.asifbacchus.dev/ab-docker/dart-sass/raw/branch/main/README.md"
|
2021-07-28 22:33:16 -06:00
|
|
|
LABEL org.opencontainers.image.source="https://git.asifbacchus.dev/ab-docker/dart-sass.git"
|
|
|
|
LABEL org.opencontainers.image.title="ab-dart-sass"
|
|
|
|
LABEL org.opencontainers.image.url="https://git.asifbacchus.dev/ab-docker/dart-sass"
|
|
|
|
LABEL org.opencontainers.image.vendor="Asif Bacchus"
|
|
|
|
|
|
|
|
# default environment variables
|
2021-07-29 00:00:52 -06:00
|
|
|
ENV PATH=$PATH:/opt/dart-sass
|
2021-07-28 22:33:16 -06:00
|
|
|
ENV TZ=Etc/UTC
|
|
|
|
ENV SASS_STYLE=compressed
|
|
|
|
|
2021-07-29 00:24:14 -06:00
|
|
|
# copy scripts and set permissions
|
2021-08-03 21:21:53 -06:00
|
|
|
COPY [ "entrypoint.sh", "/usr/local/bin/" ]
|
|
|
|
RUN chown root:root /usr/local/bin/*.sh \
|
|
|
|
&& chmod 755 /usr/local/bin/*.sh
|
2021-07-29 00:24:14 -06:00
|
|
|
|
2021-07-28 22:33:16 -06:00
|
|
|
# switch to user account and run sass compiler
|
|
|
|
USER sass
|
2021-08-01 05:39:09 -06:00
|
|
|
ENTRYPOINT [ "/usr/bin/tini", "-e", "143", "--", "/usr/local/bin/entrypoint.sh" ]
|
2021-07-28 22:33:16 -06:00
|
|
|
|
|
|
|
# set build timestamp, git and version labels
|
|
|
|
ARG INTERNAL_VERSION
|
|
|
|
ARG GIT_COMMIT
|
|
|
|
ARG BUILD_DATE
|
2021-07-28 22:45:21 -06:00
|
|
|
LABEL dev.asifbacchus.docker.internalVerson="${INTERNAL_VERSION}-${SASS_VERSION}"
|
2021-07-28 22:33:16 -06:00
|
|
|
LABEL org.opencontainers.image.version="Dart-SASS ${SASS_VERSION}"
|
|
|
|
LABEL org.opencontainers.image.revision=${GIT_COMMIT}
|
|
|
|
LABEL org.opencontainers.image.created=${BUILD_DATE}
|
|
|
|
|
|
|
|
#EOF
|