-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
- Loading branch information
Showing
24 changed files
with
11,773 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
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,33 @@ | ||
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19 as builder | ||
|
||
ARG TARGETPLATFORM | ||
ARG BUILDPLATFORM | ||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
ARG GIT_COMMIT | ||
ARG VERSION | ||
|
||
ENV GO111MODULE=on | ||
ENV GOFLAGS=-mod=vendor | ||
ENV CGO_ENABLED=0 | ||
|
||
WORKDIR /usr/bin/ | ||
|
||
WORKDIR /go/src/github.com/inlets/mixctl | ||
COPY . . | ||
|
||
# Run a gofmt and exclude all vendored code. | ||
RUN test -z "$(gofmt -l $(find . -type f -name '*.go' -not -path "./vendor/*"))" || { echo "Run \"gofmt -s -w\" on your Golang code"; exit 1; } | ||
|
||
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=0 \ | ||
go build --ldflags "-s -w \ | ||
-X github.com/inlets/mixctl/version.GitCommit=${GIT_COMMIT} \ | ||
-X github.com/inlets/mixctl/version.Version=${VERSION} \ | ||
-X github.com/inlets/mixctl/version.Platform=${TARGETARCH}" \ | ||
-a -installsuffix netgo -o /usr/bin/mixctl | ||
|
||
FROM --platform=${TARGETPLATFORM:-linux/amd64} scratch as release | ||
COPY --from=builder /usr/bin/mixctl / | ||
|
||
ENTRYPOINT ["/mixctl"] |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.