Skip to content

Commit

Permalink
Merge pull request #298 from kevinrizza/bug-1820438
Browse files Browse the repository at this point in the history
Bug 1820438: Slim down upstream builder
  • Loading branch information
openshift-merge-robot committed Apr 24, 2020
2 parents 2bdcd07 + e79673d commit 01e363e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
15 changes: 9 additions & 6 deletions upstream-builder.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.13-alpine
FROM golang:1.13-alpine AS builder

RUN apk update && apk add sqlite build-base git mercurial bash
WORKDIR /build
Expand All @@ -12,8 +12,11 @@ RUN make static
RUN GRPC_HEALTH_PROBE_VERSION=v0.2.1 && \
wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-$(go env GOARCH) && \
chmod +x /bin/grpc_health_probe
RUN cp /build/bin/opm /bin/opm && \
cp /build/bin/initializer /bin/initializer && \
cp /build/bin/appregistry-server /bin/appregistry-server && \
cp /build/bin/configmap-server /bin/configmap-server && \
cp /build/bin/registry-server /bin/registry-server

FROM scratch
COPY --from=builder /build/bin/opm /bin/opm
COPY --from=builder /build/bin/initializer /bin/initializer
COPY --from=builder /build/bin/appregistry-server /bin/appregistry-server
COPY --from=builder /build/bin/configmap-server /bin/configmap-server
COPY --from=builder /build/bin/registry-server /bin/registry-server
COPY --from=builder /bin/grpc_health_probe /bin/grpc_health_probe
18 changes: 18 additions & 0 deletions upstream-opm-builder.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM golang:1.13-alpine AS builder

RUN apk update && apk add sqlite build-base git mercurial bash
WORKDIR /build

COPY vendor vendor
COPY cmd cmd
COPY pkg pkg
COPY Makefile Makefile
COPY go.mod go.mod
RUN make static
RUN GRPC_HEALTH_PROBE_VERSION=v0.2.1 && \
wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-$(go env GOARCH) && \
chmod +x /bin/grpc_health_probe

FROM scratch
COPY --from=builder /build/bin/opm /bin/opm
COPY --from=builder /bin/grpc_health_probe /bin/grpc_health_probe

0 comments on commit 01e363e

Please sign in to comment.