Просмотр исходного кода

Add Dockerfile for a customized Swift gRPC image.

Tim Burks 9 лет назад
Родитель
Сommit
f317d11f7b
2 измененных файлов с 34 добавлено и 0 удалено
  1. 19 0
      Docker/Dockerfile
  2. 15 0
      Docker/README.md

+ 19 - 0
Docker/Dockerfile

@@ -0,0 +1,19 @@
+FROM swiftdocker/swift:latest
+MAINTAINER Tim Burks <timburks@google.com>
+
+# Install a few needed packages that aren't in swiftdocker/swift
+RUN apt-get -q update && \
+    apt-get -q install -y libz-dev && \
+    apt-get -q install -y unzip 
+
+# Install protoc
+RUN curl -O -L https://github.com/google/protobuf/releases/download/v3.2.0rc2/protoc-3.2.0rc2-linux-x86_64.zip && \
+    unzip protoc-3.2.0rc2-linux-x86_64.zip -d /usr
+
+# Build and install the swiftgrpc plugin
+RUN git clone https://github.com/grpc/grpc-swift && \
+    cd grpc-swift/Plugin && \
+    make && \
+    cp protoc-gen-swift /usr/bin && \
+    cp protoc-gen-swiftgrpc /usr/bin 
+

+ 15 - 0
Docker/README.md

@@ -0,0 +1,15 @@
+# Swift gRPC Base Image
+
+Use the Dockerfile in this directory to build a Docker image 
+that's preloaded with the Swift gRPC plugin and related tools.
+
+Build with the following command:
+
+    docker build -t grpc/swift .
+
+The following commands push the image to Google Container Registry.
+
+    docker tag grpc/swift gcr.io/swift-services/grpc
+    gcloud docker -- push gcr.io/swift-services/grpc
+
+