# Dockerfile used by OSBS and by prow CI.
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.15-openshift-4.7 AS builder
WORKDIR /go/src/github.com/jimmidyson/configmap-reload
COPY . .
ENV GOFLAGS="-mod=vendor"
RUN make out/configmap-reload

FROM registry.ci.openshift.org/ocp/4.7:base
LABEL io.k8s.display-name="OpenShift ConfigMap Reload" \
      io.k8s.description="This is a component reloads another process if a configured configmap volume is remounted." \
      io.openshift.tags="kubernetes" \
      summary="This is a component reloads another process if a configured configmap volume is remounted." \
      maintainer="OpenShift Monitoring Team <team-monitoring@redhat.com>"

ARG FROM_DIRECTORY=/go/src/github.com/jimmidyson/configmap-reload
COPY --from=builder ${FROM_DIRECTORY}/out/configmap-reload  /usr/bin/configmap-reload

USER nobody

ENTRYPOINT ["/usr/bin/configmap-reload"]
