-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
31 lines (23 loc) · 1012 Bytes
/
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
27
28
29
30
31
FROM golang:1.16-alpine AS builder
ENV PLANTUML_VERSION 1.2020.14
ENV LANG en_US.UTF-8
# Install git.
# Git is required for fetching the dependencies. - also, install java!
RUN apk update && apk add --no-cache git ca-certificates && apk add openjdk11
# Install plantuml dependancies
RUN apk add --no-cache graphviz ttf-droid ttf-droid-nonlatin curl \
&& apk add --no-cache \
--repository https://nl.alpinelinux.org/alpine/edge/testing \
&& mkdir /app \
&& curl -L https://sourceforge.net/projects/plantuml/files/plantuml.${PLANTUML_VERSION}.jar/download -o /app/plantuml.jar \
&& apk del curl
COPY . .
# We don't need GOPATH so unset it.
# If GOPATH is set go mod download will fail as it thinks there's a go.mod in the GOPATH
ENV GOPATH=""
#how to run the plantuml java app
#RUN java -jar /app/plantuml.jar -h
RUN go mod download
RUN go mod verify
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags="-w -s" -o /bin/app
ENTRYPOINT ["/bin/app"]