@@ -15,16 +15,40 @@ MAINTAINER Philip Guo <philip@pgbovine.net>
1515# http://stackoverflow.com/questions/24991136/docker-build-could-not-resolve-archive-ubuntu-com-apt-get-fails-to-install-a
1616# Uncomment the following line in /etc/default/docker DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"
1717# Restart the Docker service sudo service docker restart
18+ #
19+ # lots of packages required especially to build ruby and to use the compiled version of 'gem'
1820RUN apt-get update && apt-get install -y \
1921 nodejs \
2022 openjdk-7-jdk \
21- python
23+ python \
24+ build-essential \
25+ zlibc \
26+ zlib1g \
27+ zlib1g-dev \
28+ libssl-dev
29+
2230
2331# ugh ubuntu calls node 'nodejs'
2432RUN ln -s /usr/bin/nodejs /usr/bin/node
2533
2634
27- # Java backend (put first in Dockerfile since it doesn't change as
35+ # Ruby backend: pretty complex setup since we need to compile and
36+ # install a custom Ruby interpreter
37+ #
38+ # run all of this stuff early so that we don't invalidate the cache
39+ RUN mkdir /tmp/ruby
40+ # automatically untars
41+ ADD backends/ruby/custom-ruby-interpreter/ruby-2.2.2.tar.gz /tmp/ruby
42+ ADD backends/ruby/custom-ruby-interpreter/altered-files /tmp/ruby/ruby-2.2.2
43+ RUN mkdir /tmp/ruby/ruby-2.2.2-custom-OPT/
44+ RUN cd /tmp/ruby/ruby-2.2.2 && ./configure --prefix=/tmp/ruby/ruby-2.2.2-custom-OPT/
45+ # beware takes a long time! so make sure we cache the build
46+ RUN cd /tmp/ruby/ruby-2.2.2 && make && make install
47+ # install custom gem
48+ RUN /tmp/ruby/ruby-2.2.2-custom-OPT/bin/gem install debug_inspector
49+
50+
51+ # Java backend (put early in Dockerfile since it doesn't change as
2852# frequently and takes longer to build)
2953RUN mkdir /tmp/java_jail
3054RUN mkdir /tmp/java_jail/cp
@@ -47,31 +71,8 @@ ADD backends/python /tmp/python
4771COPY backends/java/run-java-backend.sh /tmp/
4872RUN chmod a+x /tmp/run-java-backend.sh
4973
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
7474
75+ # Ruby backend
7576COPY backends/ruby/pg_logger.rb /tmp/ruby/
7677
7778# To properly run tests, become root:
@@ -80,3 +81,5 @@ COPY backends/ruby/golden_test.py /tmp/ruby/
8081RUN mkdir /tmp/ruby/tests
8182ADD backends/ruby/tests /tmp/ruby/tests
8283RUN cd /tmp/ruby && ln -s ruby-2.2.2-custom-OPT/bin/ruby
84+
85+ RUN useradd netuser
0 commit comments