forked from score-spec/score-helm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
28 lines (21 loc) · 1014 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
# Use the official Golang image to create a build artifact.
# This is based on Debian and sets the GOPATH to /go.
# https://hub.docker.com/_/golang
FROM golang:1.19 as builder
# https://stackoverflow.com/questions/36279253/go-compiled-binary-wont-run-in-an-alpine-docker-container-on-ubuntu-host
ENV CGO_ENABLED=0
# Set the current working directory inside the container.
WORKDIR /go/src/github.com/score-spec/score-helm
# Copy the entire project and build it.
COPY . .
RUN GOOS=linux GOARCH=amd64 go build -o /usr/local/bin/score-helm ./cmd/score-helm
# Use the official Alpine image for a lean production container.
# https://hub.docker.com/_/alpine
# https://docs.docker.com/develop/develop-images/multistage-build/#use-multi-stage-builds
FROM alpine:3
# Set the current working directory inside the container.
WORKDIR /score-helm
# Copy the binary from the builder image.
COPY --from=builder /usr/local/bin/score-helm /usr/local/bin/score-helm
# Run the binary.
ENTRYPOINT ["/usr/local/bin/score-helm"]