mirror of
https://github.com/Luzifer/tex-api.git
synced 2024-11-10 01:00:07 +00:00
Migrate to Alpine as the base image
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
cf8736eef5
commit
00582cddc1
1 changed files with 20 additions and 17 deletions
37
Dockerfile
37
Dockerfile
|
@ -1,26 +1,29 @@
|
||||||
FROM golang
|
FROM golang:alpine as builder
|
||||||
|
|
||||||
MAINTAINER Knut Ahlers <knut@ahlers.me>
|
|
||||||
|
|
||||||
RUN set -ex \
|
|
||||||
&& apt-get update \
|
|
||||||
&& apt-get install -y texlive-full \
|
|
||||||
&& apt-get clean \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
ADD . /go/src/github.com/Luzifer/tex-api
|
ADD . /go/src/github.com/Luzifer/tex-api
|
||||||
WORKDIR /go/src/github.com/Luzifer/tex-api
|
WORKDIR /go/src/github.com/Luzifer/tex-api
|
||||||
|
|
||||||
RUN set -ex \
|
RUN set -ex \
|
||||||
&& apt-get update \
|
&& apk add --update git \
|
||||||
&& apt-get install -y git ca-certificates \
|
&& go install -ldflags "-X main.version=$(git describe --tags || git rev-parse --short HEAD || echo dev)"
|
||||||
&& go install -ldflags "-X main.version=$(git describe --tags || git rev-parse --short HEAD || echo dev)" \
|
|
||||||
&& apt-get clean \
|
FROM alpine:latest
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
LABEL maintainer "Knut Ahlers <knut@ahlers.me>"
|
||||||
|
|
||||||
|
RUN set -ex \
|
||||||
|
&& apk --no-cache add \
|
||||||
|
bash \
|
||||||
|
ca-certificates \
|
||||||
|
texlive-full
|
||||||
|
|
||||||
|
COPY --from=builder /go/bin/tex-api /usr/local/bin/
|
||||||
|
COPY --from=builder /go/src/github.com/Luzifer/tex-api/tex-build.sh /usr/local/bin/
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
VOLUME ["/storage"]
|
VOLUME ["/storage"]
|
||||||
|
|
||||||
ENTRYPOINT ["/go/bin/tex-api"]
|
ENTRYPOINT ["/usr/local/bin/tex-api"]
|
||||||
CMD ["--"]
|
CMD ["--script", "/usr/local/bin/tex-build.sh"]
|
||||||
|
|
||||||
|
# vim: set ft=Dockerfile:
|
||||||
|
|
Loading…
Reference in a new issue