FROM openshift/golang-builder:1.13 AS builder
ENV __doozer=update BUILD_RELEASE=202010081312.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-202010081312.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=9b0a7f7 OS_GIT_VERSION=4.5.0-202010081312.p0-9b0a7f7 SOURCE_DATE_EPOCH=1595973298 SOURCE_GIT_COMMIT=9b0a7f70ce841370444d9385084ad8f685bc983c SOURCE_GIT_TAG=v3.4.9-458-g9b0a7f70c 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.20201008.143734
ENV __doozer=update BUILD_RELEASE=202010081312.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-202010081312.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=9b0a7f7 OS_GIT_VERSION=4.5.0-202010081312.p0-9b0a7f7 SOURCE_DATE_EPOCH=1595973298 SOURCE_GIT_COMMIT=9b0a7f70ce841370444d9385084ad8f685bc983c SOURCE_GIT_TAG=v3.4.9-458-g9b0a7f70c 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="202010081312.p0" \
        io.openshift.build.commit.id="9b0a7f70ce841370444d9385084ad8f685bc983c" \
        io.openshift.build.source-location="https://github.com/openshift/etcd" \
        io.openshift.build.commit.url="https://github.com/openshift/etcd/commit/9b0a7f70ce841370444d9385084ad8f685bc983c" \
        version="v4.5.0"

