generated from xmidt-org/.go-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
39 lines (28 loc) · 913 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
32
33
34
35
36
37
38
39
FROM docker.io/library/golang:1.19-alpine as builder
WORKDIR /src
ARG VERSION
ARG GITCOMMIT
ARG BUILDTIME
RUN apk add --no-cache --no-progress \
ca-certificates \
make \
curl \
git \
openssh \
gcc \
libc-dev \
upx
RUN mkdir -p /go/bin && \
curl -o /go/bin/spruce https://github.com/geofffranks/spruce/releases/download/v1.29.0/spruce-linux-amd64 && \
chmod +x /go/bin/spruce
COPY . .
RUN make test release
FROM alpine:3.12.1
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /src/dms /src/dms.yaml /src/deploy/packaging/entrypoint.sh /go/bin/spruce /src/Dockerfile /src/NOTICE /src/LICENSE /src/CHANGELOG.md /
COPY --from=builder /src/deploy/packaging/dms.yaml /tmp/dms.yaml
RUN mkdir /etc/dms/ && touch /etc/dms/dms.yaml && chmod 666 /etc/dms/dms.yaml
USER nobody
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 11000
CMD ["/dms"]