This repository has been archived by the owner on Jul 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add initial docker push workflow (#111)
- Loading branch information
Showing
2 changed files
with
47 additions
and
3 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 |
---|---|---|
@@ -1,13 +1,14 @@ | ||
FROM golang:1.19-alpine AS builder | ||
RUN apk --no-cache add curl gcc g++ | ||
|
||
ARG cli-version | ||
|
||
WORKDIR /go/src/app | ||
COPY . . | ||
|
||
RUN curl -H "Authorization: token $GITHUB_TOKEN" --silent "https://api.github.com/repos/allero-io/allero-wip/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' > cli-version | ||
RUN go get -d -v ./... | ||
RUN go build -tags main -ldflags="-X github.com/allero-io/allero/cmd.CliVersion=$(cat cli-version)" -v | ||
RUN go build -tags main -ldflags="-X github.com/allero-io/allero/cmd.CliVersion=${cli-version}" -v | ||
|
||
FROM alpine:3.14 | ||
COPY --from=builder /go/src/app/allero / | ||
ENTRYPOINT ["/allero"] | ||
ENTRYPOINT ["/allero"] |