Skip to content
This repository has been archived by the owner on Dec 2, 2021. It is now read-only.

Commit

Permalink
split the dockerfile (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenghuiwang authored and k8s-ci-robot committed Jul 30, 2019
1 parent 9542aea commit b665859
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
23 changes: 11 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
# Build docker image at gcr.io/images-public/metadata:<tag>
# This file builds the metadata backend server image at
# gcr.io/kubeflow-images-public/metadata.
#
# The docker build flags are
# BASE_IMG: base image that has Go and Bazel installed.
# OUTPUT_DIR: the platform name that Bazel used to ouput the executable.

FROM golang:1.12
ARG BASE_IMG=gcr.io/kubeflow-images-public/metadata-base
FROM ${BASE_IMG}

ENV GO111MODULE on

RUN apt-get update && apt-get -y install cmake unzip patch wget && apt-get clean
ARG OUTPUT_DIR=linux_amd64_stripped

RUN cd /tmp && \
wget -O /tmp/bazel-installer.sh https://github.com/bazelbuild/bazel/releases/download/0.24.1/bazel-0.24.1-installer-linux-x86_64.sh && \
chmod +x bazel-installer.sh && \
./bazel-installer.sh --user

ENV PATH=/root/bin:${PATH}
ENV GO111MODULE on

WORKDIR /go/src/github.com/kubeflow/metadata

COPY . .

RUN bazel build -c opt --define=grpc_no_ares=true //...

RUN cp bazel-bin/server/linux_amd64_stripped/server server/server
RUN cp bazel-bin/server/${OUTPUT_DIR}/server server/server

# Copy Licenses
RUN wget https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt -O GRPC-GATEWAY-LICENSE.txt
Expand Down
15 changes: 15 additions & 0 deletions dockerfiles/Dockerfile-linux-base
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file builds the base image for metadata backend server.
# The images are at gcr.io/kubeflow-images-public/metadata-base.

FROM golang:1.12

RUN apt-get update && apt-get -y install cmake unzip patch wget && apt-get clean

RUN cd /tmp && \
wget -O /tmp/bazel-installer.sh https://github.com/bazelbuild/bazel/releases/download/0.24.1/bazel-0.24.1-installer-linux-x86_64.sh && \
chmod +x bazel-installer.sh && \
./bazel-installer.sh --user

ENV PATH=/root/bin:${PATH}

CMD ["bash"]

0 comments on commit b665859

Please sign in to comment.