Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile to create MUO image #1993

Merged
merged 1 commit into from
Mar 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions Dockerfile.muo
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM registry.access.redhat.com/ubi8/go-toolset:1.16.12 AS builder
ARG MUOVERSION
ENV DOWNLOAD_URL=https://github.com/openshift/managed-upgrade-operator/archive/${MUOVERSION}.tar.gz
ENV GOOS=linux \
GOPATH=/go/ \
GOARCH=amd64 \
CGO_ENABLED=0
WORKDIR ${GOPATH}/src/github.com/openshift/managed-upgrade-operator
USER root
RUN yum update -yq
RUN curl -Lq $DOWNLOAD_URL | tar -xz --strip-components=1
RUN go build -gcflags="all=-trimpath=/go/" -asmflags="all=-trimpath=/go/" -tags mandate_fips -o build/_output/bin/managed-upgrade-operator ./cmd/manager

#### Runtime container
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest

ENV USER_UID=1001 \
USER_NAME=managed-upgrade-operator

RUN microdnf update && microdnf clean all
COPY --from=builder /go/src/github.com/openshift/managed-upgrade-operator/build/_output/bin/* \
/go/src/github.com/openshift/managed-upgrade-operator/build/bin/* \
/usr/local/bin/
RUN /usr/local/bin/user_setup

ENTRYPOINT ["/usr/local/bin/entrypoint"]
USER ${USER_UID}
LABEL io.openshift.managed.name="managed-upgrade-operator" \
io.openshift.managed.description="Operator to manage upgrades for Openshift version 4 clusters"