dotfiles/packages/Dockerfile.glow

26 lines
817 B
Text

FROM alpine:3 as build
WORKDIR /root
RUN apk --no-cache add curl tar
ARG VERSION=1.3.0
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT
# We have to override ARCH if amd64
# https://github.com/charmbracelet/glow/blob/b9e5d6b144b111ade70e30b7f31e1c46f79a7ec9/.goreleaser.yml#L33-L37
RUN if [[ "${TARGETARCH}" == "amd64" ]]; then export ARCH="x86_64"; else export ARCH="${TARGETARCH}"; fi \
&& curl -L -o glow.tar.gz \
"https://github.com/charmbracelet/glow/releases/download/v${VERSION}/glow_${VERSION}_${TARGETOS}_${ARCH}${TARGETVARIANT}.tar.gz"
RUN tar -xzvf glow.tar.gz
FROM alpine:3
LABEL maintainer="Tine <mentos1386> Jozelj <tine@tjo.space>"
LABEL org.opencontainers.image.source https://github.com/mentos1386/workspace
COPY --from=build /root/glow /usr/local/bin/glow
ENTRYPOINT /usr/local/bin/glow