aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/dockerfile/grpc_ruby_base/Dockerfile
blob: ad14e43ec7b6730ce2caaf1c1ea72770a228527d (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Base Dockerfile for gRPC Ruby.
#
# Includes Ruby installation dependencies, things that are unlikely to vary.
FROM grpc/base

# Allows 'source' to work
RUN rm /bin/sh && ln -s /bin/bash /bin/sh

# Install RVM dependencies
RUN apt-get update && apt-get install -y \
    autoconf \
    automake \
    bison \
    curl \
    g++ \
    gawk \
    gcc \
    libc6-dev \
    libffi-dev \
    libgdbm-dev \
    libncurses5-dev \
    libreadline6-dev \
    libsqlite3-dev \
    libssl-dev \
    libtool \
    libyaml-dev \
    make \
    patch \
    pkg-config \
    procps \
    sqlite3 \
    zlib1g-dev


# Start the daemon that allows access to the protected git-on-borg repos
RUN /var/local/git/gcompute-tools/git-cookie-authdaemon

# Download the patched Ruby protobuf (beefcake) so that Ruby gRPC clients can
# be generated from proto3 schemas.
RUN git clone https://team.googlesource.com/one-platform-grpc-team/grpc-ruby-beefcake \
              /var/local/git/beefcake

# Install RVM, use this to install ruby
RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3  # Needed for RVM
RUN /bin/bash -l -c "curl -L get.rvm.io | bash -s stable"

# Install Ruby 2.1
RUN /bin/bash -l -c "rvm install ruby-2.1"
RUN /bin/bash -l -c "rvm use --default ruby-2.1"
RUN /bin/bash -l -c "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
RUN /bin/bash -l -c "echo 'source /home/grpc_ruby/.rvm/scripts/rvm' >> ~/.bashrc"
RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.1' >> ~/.bashrc"
RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc"

RUN git clone https://team.googlesource.com/one-platform-grpc-team/grpc /var/local/git/grpc
RUN cd /var/local/git/grpc \
  && git submodule update --init --recursive

RUN make static_c shared_c -C /var/local/git/grpc