Skip to content

Use multi-stage build for registry image. #439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 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
@@ -12,8 +12,15 @@ RUN make static
RUN GRPC_HEALTH_PROBE_VERSION=v0.3.2 && \
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 alpine:3

COPY --from=builder [ \
"/bin/grpc_health_probe", \
"/build/bin/opm", \
"/build/bin/initializer", \
"/build/bin/appregistry-server", \
"/build/bin/configmap-server", \
"/build/bin/registry-server", \
"/bin/" \
]