-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to Go 1.16 and update dependencies" (#97)
* Upgrade to Go 1.16 and update dependencies" * Typo in make for test * Moving make file back to org
- Loading branch information
1 parent
c445ee1
commit c5cedf1
Showing
6 changed files
with
47 additions
and
30 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 |
---|---|---|
|
@@ -77,3 +77,5 @@ tags | |
# End of https://www.gitignore.io/api/go,vim,emacs,visualstudiocode | ||
|
||
.idea | ||
vendor | ||
bin |
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,15 +1,31 @@ | ||
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest | ||
# Build the manager binary | ||
FROM golang:1.16 as builder | ||
|
||
ENV OPERATOR=/usr/local/bin/kubernetes-secret-generator \ | ||
USER_UID=1001 \ | ||
USER_NAME=kubernetes-secret-generator | ||
WORKDIR /workdir | ||
# ENV GOPATH=/go | ||
# Copy the Go Modules manifests | ||
COPY go.mod go.sum /workdir/ | ||
# cache deps before building and copying source so that we don't need to re-download as much | ||
# and so that source changes don't invalidate our downloaded layer | ||
RUN go mod download | ||
|
||
# install operator binary | ||
COPY build/_output/bin/kubernetes-secret-generator ${OPERATOR} | ||
RUN cat go.mod | ||
|
||
COPY build/bin /usr/local/bin | ||
RUN /usr/local/bin/user_setup | ||
# Copy the go source | ||
COPY cmd cmd | ||
COPY pkg pkg | ||
COPY version version | ||
|
||
ENTRYPOINT ["/usr/local/bin/entrypoint"] | ||
RUN ls -la /workdir | ||
|
||
USER ${USER_UID} | ||
# Build | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o /workspace/manager ./cmd/manager/main.go | ||
|
||
# Use distroless as minimal base image to package the manager binary | ||
# Refer to https://github.com/GoogleContainerTools/distroless for more details | ||
FROM gcr.io/distroless/static:nonroot | ||
WORKDIR / | ||
COPY --from=builder /workspace/manager . | ||
USER 65532:65532 | ||
|
||
ENTRYPOINT ["/manager"] |
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,6 +1,6 @@ | ||
module github.com/mittwald/kubernetes-secret-generator | ||
|
||
go 1.13 | ||
go 1.16 | ||
|
||
require ( | ||
github.com/go-logr/logr v0.1.0 | ||
|
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