forked from terrariumcloud/terrarium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
20 lines (18 loc) · 606 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
FROM golang:1.18.3 as test
ENV GOPRIVATE=github.com/terrariumcloud
WORKDIR /workspace
COPY . /workspace
RUN go test -v -cover ./...
FROM golang:1.18.3 as build
ENV CGO_ENABLED=0 GOOS=linux GARCH=amd64
WORKDIR /workspace
COPY . /workspace
RUN go mod vendor
ARG BUILD_INFO_VERSION
RUN go build -ldflags "-X 'main.buildInformationVersion=$BUILD_INFO_VERSION'" -o terrarium
RUN apt-get update && \
apt-get install -y ca-certificates
FROM scratch
COPY --from=build /workspace/terrarium /
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
ENTRYPOINT [ "/terrarium" ]