|
10 | 10 | # don't use 'latest' tag since that might change |
11 | 11 | FROM ubuntu:14.04.1 |
12 | 12 | MAINTAINER Philip Guo <philip@pgbovine.net> |
| 13 | + |
| 14 | +# if apt-get doesn't work, then follow these instructions: |
| 15 | +# http://stackoverflow.com/questions/24991136/docker-build-could-not-resolve-archive-ubuntu-com-apt-get-fails-to-install-a |
| 16 | +# Uncomment the following line in /etc/default/docker DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4" |
| 17 | +# Restart the Docker service sudo service docker restart |
13 | 18 | RUN apt-get update && apt-get install -y \ |
14 | 19 | nodejs \ |
15 | 20 | openjdk-7-jdk \ |
@@ -43,3 +48,35 @@ COPY backends/java/run-java-backend.sh /tmp/ |
43 | 48 | RUN chmod a+x /tmp/run-java-backend.sh |
44 | 49 |
|
45 | 50 | RUN useradd netuser |
| 51 | + |
| 52 | + |
| 53 | +# Ruby backend: pretty complex setup since we need to compile and |
| 54 | +# install a custom Ruby interpreter |
| 55 | + |
| 56 | +# lots of packages required to build ruby and to use the compiled version of 'gem' |
| 57 | +RUN apt-get update && apt-get install -y \ |
| 58 | + build-essential \ |
| 59 | + zlibc \ |
| 60 | + zlib1g \ |
| 61 | + zlib1g-dev \ |
| 62 | + libssl-dev |
| 63 | + |
| 64 | +RUN mkdir /tmp/ruby |
| 65 | +# automatically untars |
| 66 | +ADD backends/ruby/custom-ruby-interpreter/ruby-2.2.2.tar.gz /tmp/ruby |
| 67 | +ADD backends/ruby/custom-ruby-interpreter/altered-files /tmp/ruby/ruby-2.2.2 |
| 68 | +RUN mkdir /tmp/ruby/ruby-2.2.2-custom-OPT/ |
| 69 | +RUN cd /tmp/ruby/ruby-2.2.2 && ./configure --prefix=/tmp/ruby/ruby-2.2.2-custom-OPT/ |
| 70 | +# beware takes a long time! so make sure we cache the build |
| 71 | +RUN cd /tmp/ruby/ruby-2.2.2 && make && make install |
| 72 | +# install custom gem |
| 73 | +RUN /tmp/ruby/ruby-2.2.2-custom-OPT/bin/gem install debug_inspector |
| 74 | + |
| 75 | +COPY backends/ruby/pg_logger.rb /tmp/ruby/ |
| 76 | + |
| 77 | +# To properly run tests, become root: |
| 78 | +# $ docker run -t -i --rm --net=none --cap-drop all pgbovine/cokapi:v1 bash |
| 79 | +COPY backends/ruby/golden_test.py /tmp/ruby/ |
| 80 | +RUN mkdir /tmp/ruby/tests |
| 81 | +ADD backends/ruby/tests /tmp/ruby/tests |
| 82 | +RUN cd /tmp/ruby && ln -s ruby-2.2.2-custom-OPT/bin/ruby |
0 commit comments