This repository has been archived by the owner on Oct 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate to operator-sdk v1.3.0 (#53)
* migrate to operator-sdk v1.3.0 * add missing files * fix * append changelog * update documentation * update helm chart * fix nificlustertask integration * add custom version for helm chart * update ci for chart releasing * fix users for reader group * update documentation * append changelog * append changelog
- Loading branch information
Showing
225 changed files
with
4,618 additions
and
8,359 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,5 @@ | ||
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file | ||
# Ignore all files which are not go type | ||
!**/*.go | ||
!**/*.mod | ||
!**/*.sum |
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 |
---|---|---|
@@ -1,15 +1,28 @@ | ||
FROM golang:1.14 as build | ||
|
||
ENV GO111MODULE=on | ||
|
||
ADD tools tools | ||
RUN cd tools/health && go build -o ../../health main.go | ||
|
||
RUN useradd -u 1001 nifikop | ||
RUN mkdir -p /tmp && chown nifikop /tmp | ||
|
||
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest | ||
|
||
# Build the manager binary | ||
FROM golang:1.15 as builder | ||
|
||
WORKDIR /workspace | ||
|
||
# Copy the Go Modules manifests | ||
COPY go.mod go.mod | ||
COPY go.sum go.sum | ||
# 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 | ||
|
||
# Copy the go source | ||
COPY main.go main.go | ||
COPY api/ api/ | ||
COPY controllers/ controllers/ | ||
COPY pkg/ pkg/ | ||
COPY version/ version/ | ||
|
||
# Build | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o 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 | ||
LABEL org.opencontainers.image.documentation="https://github.com/Orange-OpenSource/nifikop/blob/master/README.md" | ||
LABEL org.opencontainers.image.authors="Alexandre Guitton <[email protected]>" | ||
LABEL org.opencontainers.image.source="https://github.com/Orange-OpenSource/nifikop" | ||
|
@@ -27,19 +40,10 @@ LABEL org.label-schema.docker.cmd.help="N/A" | |
LABEL org.label-schema.docker.cmd.debug="N/A" | ||
LABEL org.label-schema.docker.params="LOG_LEVEL=define loglevel,RESYNC_PERIOD=period in second to execute resynchronisation,WATCH_NAMESPACE=namespace to watch for nificlusters,OPERATOR_NAME=name of the operator instance pod" | ||
|
||
ENV OPERATOR=/usr/local/bin/nifikop \ | ||
USER_UID=1001 \ | ||
USER_NAME=nifikop | ||
|
||
COPY --from=build /tmp /tmp | ||
COPY --from=build /go/health / | ||
|
||
# install operator binary | ||
COPY build/_output/bin/nifikop ${OPERATOR} | ||
|
||
COPY build/bin /usr/local/bin | ||
RUN /usr/local/bin/user_setup | ||
WORKDIR / | ||
COPY --from=builder /workspace/manager . | ||
|
||
ENTRYPOINT ["/usr/local/bin/entrypoint"] | ||
#USER 65532:65532 | ||
USER 1001:1001 | ||
|
||
USER ${USER_UID} | ||
ENTRYPOINT ["/manager"] |
Oops, something went wrong.