Skip to content

Commit

Permalink
Merge pull request #18 from paulfantom/osbs
Browse files Browse the repository at this point in the history
unify Dockerfile naming and bring in upstream Dockerfile
  • Loading branch information
openshift-merge-robot committed Jul 15, 2019
2 parents cbeadfc + 7024d10 commit 2658b24
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 17 deletions.
24 changes: 7 additions & 17 deletions Dockerfile
@@ -1,21 +1,11 @@
FROM registry.svc.ci.openshift.org/openshift/release:golang-1.12 AS builder
FROM golang:1.12-alpine AS build
RUN apk add --update make && apk add --no-cache git
WORKDIR /go/src/github.com/brancz/kube-rbac-proxy
COPY . .
ENV GO111MODULE=on
# GOFLAGS is needed to build image without accessing external sources, mostly to comply with ART policies
ENV GOFLAGS="-mod=vendor"
RUN make build && \
cp _output/linux/$(go env GOARCH)/kube-rbac-proxy _output/kube-rbac-proxy
RUN make build && cp /go/src/github.com/brancz/kube-rbac-proxy/_output/linux/$(go env GOARCH)/kube-rbac-proxy /usr/local/bin

FROM registry.svc.ci.openshift.org/openshift/origin-v4.0:base
LABEL io.k8s.display-name="kube-rbac-proxy" \
io.k8s.description="This is a proxy, that can perform Kubernetes RBAC authorization." \
io.openshift.tags="kubernetes" \
maintainer="Frederic Branczyk <fbranczy@redhat.com>"

ARG FROM_DIRECTORY=/go/src/github.com/brancz/kube-rbac-proxy
COPY --from=builder ${FROM_DIRECTORY}/_output/kube-rbac-proxy /usr/bin/kube-rbac-proxy

USER nobody
FROM alpine:3.8
RUN apk add -U --no-cache ca-certificates && rm -rf /var/cache/apk/*
COPY --from=build /usr/local/bin/kube-rbac-proxy .
ENTRYPOINT ["./kube-rbac-proxy"]
EXPOSE 8080
ENTRYPOINT ["/usr/bin/kube-rbac-proxy"]
21 changes: 21 additions & 0 deletions Dockerfile.ocp
@@ -0,0 +1,21 @@
FROM registry.svc.ci.openshift.org/openshift/release:golang-1.12 AS builder
WORKDIR /go/src/github.com/brancz/kube-rbac-proxy
COPY . .
ENV GO111MODULE=on
# GOFLAGS is needed to build image without accessing external sources, mostly to comply with ART policies
ENV GOFLAGS="-mod=vendor"
RUN make build && \
cp _output/linux/$(go env GOARCH)/kube-rbac-proxy _output/kube-rbac-proxy

FROM registry.svc.ci.openshift.org/openshift/origin-v4.0:base
LABEL io.k8s.display-name="kube-rbac-proxy" \
io.k8s.description="This is a proxy, that can perform Kubernetes RBAC authorization." \
io.openshift.tags="kubernetes" \
maintainer="Frederic Branczyk <fbranczy@redhat.com>"

ARG FROM_DIRECTORY=/go/src/github.com/brancz/kube-rbac-proxy
COPY --from=builder ${FROM_DIRECTORY}/_output/kube-rbac-proxy /usr/bin/kube-rbac-proxy

USER nobody
EXPOSE 8080
ENTRYPOINT ["/usr/bin/kube-rbac-proxy"]

0 comments on commit 2658b24

Please sign in to comment.