FROM openshift/golang-builder:1.12 AS builder
ENV __doozer=update BUILD_RELEASE=202012050338.p0 BUILD_VERSION=v4.5.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=5 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.5.0-202012050338.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=41904e7 OS_GIT_VERSION=4.5.0-202012050338.p0-41904e7 SOURCE_DATE_EPOCH=1603467288 SOURCE_GIT_COMMIT=41904e79b6b8c8c3e006a23c66d39451ac3c6718 SOURCE_GIT_TAG=v3.4.9-462-g41904e79b SOURCE_GIT_URL=https://github.com/openshift/etcd 

WORKDIR /go/src/go.etcd.io/etcd

COPY . .

RUN ./build

# stage 2
FROM openshift/ose-base:v4.5.0.20201205.044256
ENV __doozer=update BUILD_RELEASE=202012050338.p0 BUILD_VERSION=v4.5.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=5 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.5.0-202012050338.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=41904e7 OS_GIT_VERSION=4.5.0-202012050338.p0-41904e7 SOURCE_DATE_EPOCH=1603467288 SOURCE_GIT_COMMIT=41904e79b6b8c8c3e006a23c66d39451ac3c6718 SOURCE_GIT_TAG=v3.4.9-462-g41904e79b SOURCE_GIT_URL=https://github.com/openshift/etcd 

ENTRYPOINT ["/usr/bin/etcd"]

COPY --from=builder /go/src/go.etcd.io/etcd/bin/etcd /usr/bin/
COPY --from=builder /go/src/go.etcd.io/etcd/bin/etcdctl /usr/bin/
COPY --from=builder /go/src/go.etcd.io/etcd/bin/discover-etcd-initial-cluster /usr/bin/

LABEL \
        io.k8s.display-name="etcd server" \
        io.k8s.description="etcd is distributed key-value store which stores the persistent master state for Kubernetes and OpenShift." \
        maintainer="Sam Batschelet <sbatsche@redhat.com>" \
        License="Apache 2.0" \
        io.openshift.tags="etcd" \
        name="openshift/ose-etcd" \
        com.redhat.component="ose-etcd-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        release="202012050338.p0" \
        io.openshift.build.commit.id="41904e79b6b8c8c3e006a23c66d39451ac3c6718" \
        io.openshift.build.source-location="https://github.com/openshift/etcd" \
        io.openshift.build.commit.url="https://github.com/openshift/etcd/commit/41904e79b6b8c8c3e006a23c66d39451ac3c6718" \
        version="v4.5.0"

