Skip to content

Instantly share code, notes, and snippets.

@vyper
Created September 23, 2016 19:34
Show Gist options
  • Save vyper/4445a825f0171a0c377821ea50c96e02 to your computer and use it in GitHub Desktop.
Save vyper/4445a825f0171a0c377821ea50c96e02 to your computer and use it in GitHub Desktop.
Dockerfile to generate protos
FROM ruby:2.3.0-alpine
ENV PROTOBUF_VERSION 3.0.2
RUN apk add --update build-base autoconf automake libtool git perl && \
curl --location --silent --output /tmp/protobuf.tar.gz https://github.com/google/protobuf/archive/v$PROTOBUF_VERSION.tar.gz && \
tar xfz /tmp/protobuf.tar.gz -C /tmp/ && \
cd /tmp/protobuf-$PROTOBUF_VERSION && \
./autogen.sh && \
./configure --prefix=/usr && \
make -j 3 && \
make check && \
make install && \
rm -rf /tmp/protobuf-$PROTOBUF_VERSION
RUN apk add --update libstdc++
RUN mkdir /usr/local/grpc && \
git clone https://github.com/grpc/grpc.git /usr/local/grpc --depth 1 && \
git submodule update --init && \
make grpc_ruby_plugin && \
RUN cd ~ && \
apk del build-base autoconf automake libtool git perl && \
rm -rf /var/cache/apk/* && \
rm -rf /usr/local/grpc && \
rm -rf /usr/local/include
RUN mkdir /app
WORKDIR /app
ADD Gemfile* /app/
RUN bundle install --jobs 20 --retry 5
ADD . /app
EXPOSE 8080
# ENTRYPOINT ["bundle", "exec"]
# CMD ["bundle", "exec", "ruby", "./server.rb"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment