spruce/Dockerfile
Dan Anglin 93da4f6648
fix: docker support improvements
- Build the binary with Mage.
- Set the ENTRYPOINT to "spruce".
- Add instructions on building and using the docker image.
2023-08-16 03:33:13 +01:00

48 lines
872 B
Docker

# syntax=docker/dockerfile:1
FROM golang:1.21-alpine AS builder
ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOARCH=amd64
WORKDIR /tmp
RUN apk add --no-cache git \
&& git clone https://github.com/magefile/mage
WORKDIR /tmp/mage
RUN go run bootstrap.go
COPY . /workspace
WORKDIR /workspace
RUN mage build
FROM alpine:3.18
COPY --from=builder /workspace/spruce /usr/local/bin
# Install dependencies
RUN apk upgrade --no-cache \
&& apk add --no-cache \
font-carlito \
aspell \
curl \
&& mkdir /opt/context /workspace
ENV OSFONTDIR=/usr/share/fonts
WORKDIR /opt/context
# Install ConTeXt standalone
RUN curl -LO http://lmtx.pragma-ade.com/install-lmtx/context-linuxmusl.zip \
&& unzip context-linuxmusl.zip \
&& sh install.sh
ENV PATH=${PATH}:/opt/context/tex/texmf-linuxmusl/bin
WORKDIR /workspace
ENTRYPOINT ["spruce"]