-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
26 lines (21 loc) · 1.12 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
FROM mcr.microsoft.com/devcontainers/base:debian as build
# VARIANT can be either 'hugo' for the standard version or 'hugo_extended' for the extended version.
ARG VARIANT=hugo_extended
# VERSION can be either 'latest' or a specific version number
ARG HUGO_VERSION=latest
ARG SASS_VERSION=latest
RUN apt-get install ca-certificates jq
RUN URL=$(curl -s https://api.github.com/repos/gohugoio/hugo/releases/${HUGO_VERSION} | jq -r ".assets[] | select(.name | test(\"${VARIANT}.*Linux-64bit.tar.gz\")) | .browser_download_url") && \
wget -O ${HUGO_VERSION}.tar.gz "${URL}" && \
tar xf ${HUGO_VERSION}.tar.gz && \
mv hugo* /usr/bin/hugo
RUN URL=$(curl -s https://api.github.com/repos/sass/dart-sass/releases/${SASS_VERSION} | jq -r ".assets[] | select(.name | test(\".*linux-x64-musl.tar.gz\")) | .browser_download_url") && \
wget -O ${SASS_VERSION}.tar.gz "${URL}" && \
tar xf ${SASS_VERSION}.tar.gz && \
mv dart-sass/sass /usr/bin/sass
FROM mcr.microsoft.com/devcontainers/javascript-node
COPY --from=build /usr/bin/hugo /usr/bin
COPY --from=build /usr/bin/sass /usr/bin
EXPOSE 1313
WORKDIR /src
CMD ["/usr/bin/hugo server"]