FROM openshift/golang-builder:1.10 AS builder
ENV SOURCE_GIT_COMMIT=1a054c609392bfac76299685f0d34f592520a288 SOURCE_DATE_EPOCH=1557151792 BUILD_VERSION=v4.1.25 SOURCE_GIT_URL=https://github.com/openshift/etcd SOURCE_GIT_TAG=v3.3.10-10-g1a054c6 BUILD_RELEASE=201911190028

WORKDIR /go/src/github.com/coreos/etcd

COPY . .

RUN make build

# stage 2
FROM openshift/ose-base:v4.1.25.20191119.002830
ENV SOURCE_GIT_COMMIT=1a054c609392bfac76299685f0d34f592520a288 SOURCE_DATE_EPOCH=1557151792 BUILD_VERSION=v4.1.25 SOURCE_GIT_URL=https://github.com/openshift/etcd SOURCE_GIT_TAG=v3.3.10-10-g1a054c6 BUILD_RELEASE=201911190028

ENTRYPOINT ["/usr/bin/etcd"]

COPY --from=builder /go/src/github.com/coreos/etcd/bin/etcd /usr/bin/
COPY --from=builder /go/src/github.com/coreos/etcd/bin/etcdctl /usr/bin/

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

