-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing Dockerfile and adapt the version passed to operator
Signed-off-by: Itxaka <[email protected]>
- Loading branch information
Itxaka
committed
Jul 11, 2022
1 parent
01c7190
commit 66f27eb
Showing
4 changed files
with
29 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
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,15 @@ | ||
FROM golang:1.17-alpine as build | ||
ENV CGO_ENABLED=0 | ||
WORKDIR /src | ||
COPY go.mod go.sum /src/ | ||
RUN go mod download | ||
COPY main.go /src/ | ||
COPY pkg /src/pkg | ||
COPY cmd /src/cmd | ||
# Set arg/env after go mod download, otherwise we invalidate the cached layers due to the commit changing easily | ||
ARG VERSION=0.0.0 | ||
ENV VERSION=${VERSION} | ||
RUN go build -ldflags "-extldflags -static -s -X 'github.com/rancher/elemental-operator/version.Version=$(VERSION)'" -o /usr/sbin/rancheros-operator | ||
|
||
FROM scratch as ros-operator | ||
COPY --from=build /usr/sbin/rancheros-operator /usr/sbin/rancheros-operator |