Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d67561e
commit 1a3406e
Showing
4 changed files
with
43 additions
and
6 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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/.dockerignore | ||
/Dockerfile | ||
/Dockerfile.buildkit | ||
/.git/ | ||
/.github/ | ||
/.gitignore | ||
|
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
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
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,40 @@ | ||
FROM --platform=$BUILDPLATFORM golang:1.14-alpine as builder | ||
LABEL maintainer="Antonio Mika <me@antoniomika.me>" | ||
|
||
ENV GOCACHE /gocache | ||
ENV CGO_ENABLED 0 | ||
|
||
WORKDIR /app | ||
|
||
RUN apk add --no-cache git ca-certificates | ||
|
||
COPY go.mod . | ||
COPY go.sum . | ||
|
||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
ARG VERSION=dev | ||
ARG COMMIT=none | ||
ARG DATE=unknown | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
ENV GOOS=${TARGETOS} GOARCH=${TARGETARCH} | ||
|
||
RUN go build -o /go/bin/sish -ldflags="-s -w -X github.com/antoniomika/sish/cmd.Version=${VERSION} -X github.com/antoniomika/sish/cmd.Commit=${COMMIT} -X github.com/antoniomika/sish/cmd.Date=${DATE}" | ||
|
||
FROM scratch as release | ||
LABEL maintainer="Antonio Mika <me@antoniomika.me>" | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /tmp /tmp | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=builder /app/deploy/pubkeys /app/deploy/pubkeys | ||
COPY --from=builder /app/templates /app/templates | ||
COPY --from=builder /go/bin/sish /app/sish | ||
|
||
ENTRYPOINT ["/app/sish"] |