FROM openshift/golang-builder:rhel_8_golang_1.15 AS builder
ENV __doozer=update BUILD_RELEASE=202104030128.p0 BUILD_VERSION=v4.7.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=7 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.7.0-202104030128.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge KUBE_GIT_COMMIT=14156f392c82ac10a230c313cc93b3951af1f592 KUBE_GIT_MAJOR=1 KUBE_GIT_MINOR=19+ KUBE_GIT_TREE_STATE=clean KUBE_GIT_VERSION=v1.19.3+14156f3 OS_GIT_COMMIT=14156f3 OS_GIT_VERSION=4.7.0-202104030128.p0-14156f3 SOURCE_DATE_EPOCH=1616783450 SOURCE_GIT_COMMIT=14156f392c82ac10a230c313cc93b3951af1f592 SOURCE_GIT_TAG=v4.0.0-232-g14156f392 SOURCE_GIT_URL=https://github.com/openshift/builder 
WORKDIR /go/src/github.com/openshift/builder
COPY . .
RUN hack/build.sh

FROM openshift/ose-base:ubi8
ENV __doozer=update BUILD_RELEASE=202104030128.p0 BUILD_VERSION=v4.7.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=7 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.7.0-202104030128.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge KUBE_GIT_COMMIT=14156f392c82ac10a230c313cc93b3951af1f592 KUBE_GIT_MAJOR=1 KUBE_GIT_MINOR=19+ KUBE_GIT_TREE_STATE=clean KUBE_GIT_VERSION=v1.19.3+14156f3 OS_GIT_COMMIT=14156f3 OS_GIT_VERSION=4.7.0-202104030128.p0-14156f3 SOURCE_DATE_EPOCH=1616783450 SOURCE_GIT_COMMIT=14156f392c82ac10a230c313cc93b3951af1f592 SOURCE_GIT_TAG=v4.0.0-232-g14156f392 SOURCE_GIT_URL=https://github.com/openshift/builder 
RUN INSTALL_PKGS=" \
      bind-utils bsdtar findutils fuse-overlayfs git hostname lsof \
      procps-ng runc socat tar tree util-linux wget which \
      " && \
    yum install -y --setopt=skip_missing_names_on_install=False $INSTALL_PKGS && \
    yum clean all
COPY --from=builder /go/src/github.com/openshift/builder/openshift-builder /usr/bin/
COPY imagecontent/bin /usr/bin
COPY imagecontent/etc/containers /etc/containers
COPY imagecontent/usr/share/containers /usr/share/containers
RUN mkdir -p /var/cache/blobs \
    /var/lib/shared/overlay-images \
    /var/lib/shared/overlay-layers && \
    touch /var/lib/shared/overlay-images/images.lock \
    /var/lib/shared/overlay-layers/layers.lock

RUN ln -s /usr/bin/openshift-builder /usr/bin/openshift-sti-build && \
    ln -s /usr/bin/openshift-builder /usr/bin/openshift-docker-build && \
    ln -s /usr/bin/openshift-builder /usr/bin/openshift-git-clone && \
    ln -s /usr/bin/openshift-builder /usr/bin/openshift-manage-dockerfile && \
    ln -s /usr/bin/openshift-builder /usr/bin/openshift-extract-image-content
ENTRYPOINT [ "/usr/bin/entrypoint.sh" ]

LABEL \
        io.k8s.display-name="OpenShift Container Platform Container Builder" \
        io.k8s.description="This is a component of OpenShift Container Platform and is responsible for executing container image builds." \
        io.openshift.tags="openshift,builder" \
        License="GPLv2+" \
        vendor="Red Hat" \
        name="openshift/ose-docker-builder" \
        com.redhat.component="openshift-enterprise-builder-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Build" \
        release="202104030128.p0" \
        io.openshift.build.commit.id="14156f392c82ac10a230c313cc93b3951af1f592" \
        io.openshift.build.source-location="https://github.com/openshift/builder" \
        io.openshift.build.commit.url="https://github.com/openshift/builder/commit/14156f392c82ac10a230c313cc93b3951af1f592" \
        version="v4.7.0"

