-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
41 lines (30 loc) · 915 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
40
41
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/svalinn /src/svalinn.yaml /src/deploy/packaging/entrypoint.sh /go/bin/spruce /src/Dockerfile /src/NOTICE /src/LICENSE /src/CHANGELOG.md /
RUN mkdir /etc/svalinn/ && touch /etc/svalinn/svalinn.yaml && chmod 666 /etc/svalinn/svalinn.yaml
USER nobody
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 6600
EXPOSE 6601
EXPOSE 6602
EXPOSE 6603
CMD ["/svalinn"]