| OLD | NEW |
| 1 # This Dockerfile specifies the recipe for creating an image for the tests | 1 # This Dockerfile specifies the recipe for creating an image for the tests |
| 2 # to run in. | 2 # to run in. |
| 3 # | 3 # |
| 4 # We install as many test dependencies here as we can, because these setup | 4 # We install as many test dependencies here as we can, because these setup |
| 5 # steps can be cached. They do *not* run every time we run the build. | 5 # steps can be cached. They do *not* run every time we run the build. |
| 6 # The Docker image is only rebuilt when the Dockerfile (ie. this file) | 6 # The Docker image is only rebuilt when the Dockerfile (ie. this file) |
| 7 # changes. | 7 # changes. |
| 8 | 8 |
| 9 # Base Dockerfile for gRPC dev images | 9 # Base Dockerfile for gRPC dev images |
| 10 FROM debian:latest | 10 FROM debian:latest |
| 11 | 11 |
| 12 # Apt source for old Python versions. | 12 # Apt source for old Python versions. |
| 13 RUN echo 'deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu trusty main' > /
etc/apt/sources.list.d/deadsnakes.list && \ | 13 RUN echo 'deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu trusty main' > /
etc/apt/sources.list.d/deadsnakes.list && \ |
| 14 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DB82666C | 14 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DB82666C |
| 15 | 15 |
| 16 # Apt source for Oracle Java. | 16 # Apt source for Oracle Java. |
| 17 RUN echo 'deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main' > /e
tc/apt/sources.list.d/webupd8team-java-trusty.list && \ | 17 run echo 'deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main' > /e
tc/apt/sources.list.d/webupd8team-java-trusty.list && \ |
| 18 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886 && \ | 18 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886 && \ |
| 19 echo "oracle-java7-installer shared/accepted-oracle-license-v1-1 select true"
| debconf-set-selections | 19 echo "oracle-java7-installer shared/accepted-oracle-license-v1-1 select true"
| debconf-set-selections |
| 20 | 20 |
| 21 # Apt source for Mono | 21 # Apt source for Mono |
| 22 RUN echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /e
tc/apt/sources.list.d/mono-xamarin.list && \ | 22 run echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /e
tc/apt/sources.list.d/mono-xamarin.list && \ |
| 23 echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat
main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list && \ | 23 echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat
main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list && \ |
| 24 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA
29AA6A19B38D3D831EF | 24 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA
29AA6A19B38D3D831EF |
| 25 | 25 |
| 26 # Apt source for php | |
| 27 RUN echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu trusty main" | tee /etc
/apt/sources.list.d/various-php.list && \ | |
| 28 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F4FCBB07 | |
| 29 | |
| 30 # Install dotnet SDK based on https://www.microsoft.com/net/core#debian | |
| 31 # (Ubuntu instructions need apt to support https) | |
| 32 RUN apt-get update && apt-get install -y --force-yes curl libunwind8 gettext &&
\ | |
| 33 curl -sSL -o dotnet.tar.gz https://go.microsoft.com/fwlink/?LinkID=809130 &&
\ | |
| 34 mkdir -p /opt/dotnet && tar zxf dotnet.tar.gz -C /opt/dotnet && \ | |
| 35 ln -s /opt/dotnet/dotnet /usr/local/bin | |
| 36 | |
| 37 # Install dependencies. We start with the basic ones require to build protoc | 26 # Install dependencies. We start with the basic ones require to build protoc |
| 38 # and the C++ build | 27 # and the C++ build |
| 39 RUN apt-get clean && apt-get update && apt-get install -y --force-yes \ | 28 RUN apt-get update && apt-get install -y \ |
| 40 autoconf \ | 29 autoconf \ |
| 41 autotools-dev \ | 30 autotools-dev \ |
| 42 build-essential \ | 31 build-essential \ |
| 43 bzip2 \ | 32 bzip2 \ |
| 44 ccache \ | 33 ccache \ |
| 45 curl \ | 34 curl \ |
| 46 gcc \ | 35 gcc \ |
| 47 git \ | 36 git \ |
| 48 libc6 \ | 37 libc6 \ |
| 49 libc6-dbg \ | 38 libc6-dbg \ |
| (...skipping 18 matching lines...) Expand all Loading... |
| 68 oracle-java7-installer \ | 57 oracle-java7-installer \ |
| 69 # -- For python / python_cpp -- \ | 58 # -- For python / python_cpp -- \ |
| 70 python-setuptools \ | 59 python-setuptools \ |
| 71 python-pip \ | 60 python-pip \ |
| 72 python-dev \ | 61 python-dev \ |
| 73 python2.6-dev \ | 62 python2.6-dev \ |
| 74 python3.3-dev \ | 63 python3.3-dev \ |
| 75 python3.4-dev \ | 64 python3.4-dev \ |
| 76 # -- For Ruby -- | 65 # -- For Ruby -- |
| 77 ruby \ | 66 ruby \ |
| 78 # -- For C++ benchmarks -- | |
| 79 cmake \ | |
| 80 # -- For PHP -- | |
| 81 php5.5 \ | |
| 82 php5.5-dev \ | |
| 83 php5.5-xml \ | |
| 84 php5.6 \ | |
| 85 php5.6-dev \ | |
| 86 php5.6-xml \ | |
| 87 php7.0 \ | |
| 88 php7.0-dev \ | |
| 89 php7.0-xml \ | |
| 90 phpunit \ | |
| 91 valgrind \ | |
| 92 libxml2-dev \ | |
| 93 && apt-get clean | 67 && apt-get clean |
| 94 | 68 |
| 95 ################## | 69 ################## |
| 96 # C# dependencies | 70 # C# dependencies |
| 97 | 71 |
| 98 RUN wget www.nuget.org/NuGet.exe -O /usr/local/bin/nuget.exe | 72 RUN wget www.nuget.org/NuGet.exe -O /usr/local/bin/nuget.exe |
| 99 | 73 |
| 100 ################## | 74 ################## |
| 101 # Python dependencies | 75 # Python dependencies |
| 102 | 76 |
| 103 # These packages exist in apt-get, but their versions are too old, so we have | 77 # These packages exist in apt-get, but their versions are too old, so we have |
| 104 # to get updates from pip. | 78 # to get updates from pip. |
| 105 | 79 |
| 106 RUN pip install pip --upgrade | 80 RUN pip install pip --upgrade |
| 107 RUN pip install virtualenv tox yattag | 81 RUN pip install virtualenv tox yattag |
| 108 | 82 |
| 83 |
| 109 ################## | 84 ################## |
| 110 # Ruby dependencies | 85 # Ruby dependencies |
| 111 | 86 |
| 112 # Install rvm | 87 # Install rvm |
| 113 RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A170311380
4BB82D39DC0E3 | 88 RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A170311380
4BB82D39DC0E3 |
| 114 RUN \curl -sSL https://get.rvm.io | bash -s stable | 89 RUN \curl -sSL https://get.rvm.io | bash -s stable |
| 115 | 90 |
| 116 # Install Ruby 2.1, Ruby 2.2 and JRuby 1.7 | 91 # Install Ruby 2.1 |
| 117 RUN /bin/bash -l -c "rvm install ruby-2.1" | 92 RUN /bin/bash -l -c "rvm install ruby-2.1" |
| 118 RUN /bin/bash -l -c "rvm install ruby-2.2" | 93 RUN /bin/bash -l -c "rvm use --default ruby-2.1" |
| 119 RUN /bin/bash -l -c "rvm install jruby-1.7" | |
| 120 RUN /bin/bash -l -c "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc" | 94 RUN /bin/bash -l -c "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc" |
| 121 RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" | 95 RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" |
| 96 RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.1' >> ~/.bashrc" |
| 122 RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc" | 97 RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc" |
| 123 | 98 |
| 124 ################## | 99 ################## |
| 125 # Java dependencies | 100 # Java dependencies |
| 126 | 101 |
| 127 # This step requires compiling protoc. :( | 102 # This step requires compiling protoc. :( |
| 128 | 103 |
| 129 ENV MAVEN_REPO /var/maven_local_repository | 104 ENV MAVEN_REPO /var/maven_local_repository |
| 130 ENV MVN mvn --batch-mode | 105 ENV MVN mvn --batch-mode |
| 131 | 106 |
| 132 RUN cd /tmp && \ | 107 RUN cd /tmp && \ |
| 133 git clone https://github.com/google/protobuf.git && \ | 108 git clone https://github.com/google/protobuf.git && \ |
| 134 cd protobuf && \ | 109 cd protobuf && \ |
| 135 git reset bf379715c93b581eeb078cec1f0dd8a7d79df431 && \ | |
| 136 ./autogen.sh && \ | 110 ./autogen.sh && \ |
| 137 ./configure && \ | 111 ./configure && \ |
| 138 make -j4 && \ | 112 make -j6 && \ |
| 139 cd java && \ | 113 cd java && \ |
| 114 $MVN install dependency:go-offline -Dmaven.repo.local=$MAVEN_REPO -P lite && \ |
| 140 $MVN install dependency:go-offline -Dmaven.repo.local=$MAVEN_REPO && \ | 115 $MVN install dependency:go-offline -Dmaven.repo.local=$MAVEN_REPO && \ |
| 141 cd ../javanano && \ | 116 cd ../javanano && \ |
| 142 $MVN install dependency:go-offline -Dmaven.repo.local=$MAVEN_REPO | 117 $MVN install dependency:go-offline -Dmaven.repo.local=$MAVEN_REPO |
| 143 | 118 |
| 144 ################## | 119 ################## |
| 145 # PHP dependencies. | |
| 146 RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
| 147 RUN php composer-setup.php | |
| 148 RUN mv composer.phar /usr/bin/composer | |
| 149 RUN php -r "unlink('composer-setup.php');" | |
| 150 RUN cd /tmp && \ | |
| 151 rm -rf protobuf && \ | |
| 152 git clone https://github.com/google/protobuf.git && \ | |
| 153 cd protobuf && \ | |
| 154 git reset 46ae90dc5e145b12fffa7e053a908a9f3e066286 && \ | |
| 155 cd php && \ | |
| 156 ln -sfn /usr/bin/php5.5 /usr/bin/php && \ | |
| 157 ln -sfn /usr/bin/php-config5.5 /usr/bin/php-config && \ | |
| 158 ln -sfn /usr/bin/phpize5.5 /usr/bin/phpize && \ | |
| 159 composer install && \ | |
| 160 mv vendor /usr/local/vendor-5.5 && \ | |
| 161 ln -sfn /usr/bin/php5.6 /usr/bin/php && \ | |
| 162 ln -sfn /usr/bin/php-config5.6 /usr/bin/php-config && \ | |
| 163 ln -sfn /usr/bin/phpize5.6 /usr/bin/phpize && \ | |
| 164 composer install && \ | |
| 165 mv vendor /usr/local/vendor-5.6 && \ | |
| 166 ln -sfn /usr/bin/php7.0 /usr/bin/php && \ | |
| 167 ln -sfn /usr/bin/php-config7.0 /usr/bin/php-config && \ | |
| 168 ln -sfn /usr/bin/phpize7.0 /usr/bin/phpize && \ | |
| 169 composer install && \ | |
| 170 mv vendor /usr/local/vendor-7.0 | |
| 171 RUN wget http://am1.php.net/get/php-5.5.38.tar.bz2/from/this/mirror | |
| 172 RUN mv mirror php-5.5.38.tar.bz2 | |
| 173 RUN tar -xvf php-5.5.38.tar.bz2 | |
| 174 RUN cd php-5.5.38 && ./configure --enable-maintainer-zts --prefix=/usr/local/php
-5.5-zts && \ | |
| 175 make && make install | |
| 176 | |
| 177 ################## | |
| 178 # Go dependencies. | |
| 179 RUN apt-get install -y \ | |
| 180 # -- For go -- \ | |
| 181 golang | |
| 182 | |
| 183 ################## | |
| 184 # Javascript dependencies. | |
| 185 RUN apt-get install -y \ | |
| 186 # -- For javascript -- \ | |
| 187 npm | |
| 188 | |
| 189 # On Debian/Ubuntu, nodejs binary is named 'nodejs' because the name 'node' | |
| 190 # is taken by another legacy binary. We don't have that legacy binary and | |
| 191 # npm expects the binary to be named 'node', so we just create a symbol | |
| 192 # link here. | |
| 193 RUN ln -s `which nodejs` /usr/bin/node | |
| 194 | |
| 195 ################## | |
| 196 # Prepare ccache | 120 # Prepare ccache |
| 197 | 121 |
| 198 RUN ln -s /usr/bin/ccache /usr/local/bin/gcc | 122 RUN ln -s /usr/bin/ccache /usr/local/bin/gcc |
| 199 RUN ln -s /usr/bin/ccache /usr/local/bin/g++ | 123 RUN ln -s /usr/bin/ccache /usr/local/bin/g++ |
| 200 RUN ln -s /usr/bin/ccache /usr/local/bin/cc | 124 RUN ln -s /usr/bin/ccache /usr/local/bin/cc |
| 201 RUN ln -s /usr/bin/ccache /usr/local/bin/c++ | 125 RUN ln -s /usr/bin/ccache /usr/local/bin/c++ |
| 202 RUN ln -s /usr/bin/ccache /usr/local/bin/clang | 126 RUN ln -s /usr/bin/ccache /usr/local/bin/clang |
| 203 RUN ln -s /usr/bin/ccache /usr/local/bin/clang++ | 127 RUN ln -s /usr/bin/ccache /usr/local/bin/clang++ |
| 204 | 128 |
| 205 # Define the default command. | 129 # Define the default command. |
| 206 CMD ["bash"] | 130 CMD ["bash"] |
| OLD | NEW |