forked from jimmidyson/configmap-reload
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from pgier/multi-stage-docker-build
update Dockerfile to use multi-stage build
- Loading branch information
Showing
1 changed file
with
10 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,17 @@ | ||
FROM openshift/origin-base | ||
FROM registry.svc.ci.openshift.org/openshift/release:golang-1.10 AS builder | ||
WORKDIR /go/src/github.com/jimmidyson/configmap-reload | ||
COPY . . | ||
RUN make out/configmap-reload | ||
|
||
ENV GOPATH /go | ||
RUN mkdir -p $GOPATH/bin | ||
|
||
COPY . $GOPATH/src/github.com/jimmidyson/configmap-reload | ||
|
||
RUN yum install -y golang make git && \ | ||
cd $GOPATH/src/github.com/jimmidyson/configmap-reload && \ | ||
PATH=$PATH:$GOPATH/bin make out/configmap-reload GOPATH=$GOPATH && cp $GOPATH/src/github.com/jimmidyson/configmap-reload/out/configmap-reload /usr/bin/configmap-reload && \ | ||
yum autoremove -y golang make git && yum clean all | ||
|
||
LABEL io.k8s.display-name="configmap reload" \ | ||
FROM registry.svc.ci.openshift.org/openshift/origin-v4.0: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" \ | ||
maintainer="Frederic Branczyk <[email protected]>" | ||
|
||
# doesn't require a root user. | ||
USER 1001 | ||
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"] |