-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
25 lines (23 loc) · 779 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
############################
# STEP 1 build executable binary
############################
FROM golang:alpine AS builder
# Install git.
# Git is required for fetching the dependencies.
RUN apk update && apk add --no-cache ca-certificates git
WORKDIR $GOPATH/src/github.com/mdelapenya/junit2otlp
COPY . .
# Build the binary.
RUN GOOS=linux GOARCH=386 go build -ldflags="-w -s" -o /go/bin/junit2otlp
############################
# STEP 2 build a small image
############################
FROM scratch
ENV USER=junit2otlp
# Copy default certificates
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
# Copy our static executable.
COPY --from=builder /go/bin/junit2otlp /go/bin/junit2otlp
# Run the junit2otlp binary.
ENTRYPOINT ["/go/bin/junit2otlp"]
CMD [""]