-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Dockerfile to the build directory
This prepares for a `Dockerfile` CI check in the framework. Signed-off-by: Dale Haiducek <[email protected]>
- Loading branch information
1 parent
f4d8ced
commit fc19946
Showing
2 changed files
with
34 additions
and
33 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 @@ | ||
./build/Dockerfile |
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 @@ | ||
# Copyright Contributors to the Open Cluster Management project | ||
|
||
# Stage 1: Use image builder to build the target binaries | ||
FROM registry.ci.openshift.org/stolostron/builder:go1.20-linux AS builder | ||
|
||
ENV COMPONENT=cert-policy-controller | ||
ENV REPO_PATH=/go/src/github.com/stolostron/${COMPONENT} | ||
WORKDIR ${REPO_PATH} | ||
COPY . . | ||
RUN make build | ||
|
||
# Stage 2: Copy the binaries from the image builder to the base image | ||
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest | ||
|
||
ENV COMPONENT=cert-policy-controller | ||
ENV REPO_PATH=/go/src/github.com/stolostron/${COMPONENT} | ||
ENV OPERATOR=/usr/local/bin/${COMPONENT} \ | ||
USER_UID=1001 \ | ||
USER_NAME=${COMPONENT} | ||
|
||
# install operator binary | ||
COPY --from=builder ${REPO_PATH}/build/_output/bin/${COMPONENT} ${OPERATOR} | ||
|
||
COPY --from=builder ${REPO_PATH}/build/bin /usr/local/bin | ||
RUN /usr/local/bin/user_setup | ||
|
||
RUN microdnf update && \ | ||
microdnf install shadow-utils procps && \ | ||
microdnf clean all | ||
|
||
ENTRYPOINT ["/usr/local/bin/entrypoint"] | ||
|
||
USER ${USER_UID} |