This repository has been archived by the owner on Jul 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
go dependencies in alpine Signed-off-by: Patrick Rachford <[email protected]>
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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"] |