aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/dockerfile/grpc_go/Dockerfile
blob: 1b998152a780b9bdee6bafb070cc2685c8ffa435 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Dockerfile for gRPC Go
FROM golang:1.4

# Install SSH to that Go source can be pulled securely.
RUN apt-get update && apt-get install -y ssh

# Install a GitHub SSH service credential that gives access to the GitHub repo while it's private
#
# TODO: remove this once the repo is public
ADD .ssh .ssh
RUN chmod 600 /.ssh/github.rsa
RUN mkdir -p $HOME/.ssh && echo 'Host github.com' > $HOME/.ssh/config
RUN echo "    IdentityFile /.ssh/github.rsa" >> $HOME/.ssh/config
RUN echo 'StrictHostKeyChecking no' >> $HOME/.ssh/config

# Force go get to use the GitHub ssh url instead of https, and use the SSH creds
RUN git config --global url."git@github.com:".insteadOf "https://github.com/"

# Get the source from GitHub
RUN go get github.com/google/grpc-go/rpc

# Build the interop client and server
RUN cd src/github.com/google/grpc-go/rpc/interop/client && go install
RUN cd src/github.com/google/grpc-go/rpc/interop/server && go install

# Specify the default command such that the interop server runs on its known testing port
CMD ["/bin/bash", "-c", "cd src/github.com/google/grpc-go/rpc/interop/server && go run server.go --use_tls=true --port=8020"]