jfarrell | e03f7e8 | 2015-02-18 23:25:54 -0500 | [diff] [blame] | 1 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 2 | # you may not use this file except in compliance with the License. |
| 3 | # You may obtain a copy of the License at |
| 4 | # |
| 5 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | # |
| 7 | # Unless required by applicable law or agreed to in writing, software |
| 8 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 10 | # See the License for the specific language governing permissions and |
| 11 | # limitations under the License. |
| 12 | |
jfarrell | e03f7e8 | 2015-02-18 23:25:54 -0500 | [diff] [blame] | 13 | # |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 14 | # Apache Thrift Docker build environment for Ubuntu Trusty |
| 15 | # Using all stock Ubuntu Trusty packaging except for: |
| 16 | # - d: does not come with Ubuntu so we're installing 2.070.0 |
| 17 | # - dart: does not come with Ubuntu so we're installing 1.20.1 |
| 18 | # - dotnetcore, disabled because netcore is for 1.0.0-preview and 2.0.0 is out |
| 19 | # - haxe, disabled because the distro comes with 3.0.0 and it cores while installing |
| 20 | # - node.js, disabled because it is at 0.10.0 in the distro which is too old (need 4+) |
| 21 | # - ocaml, disabled because it fails to install properly |
| 22 | # |
jfarrell | e03f7e8 | 2015-02-18 23:25:54 -0500 | [diff] [blame] | 23 | |
Nobuaki Sukegawa | 7be78ea | 2016-05-15 00:25:04 +0900 | [diff] [blame] | 24 | FROM buildpack-deps:trusty-scm |
jfarrell | e03f7e8 | 2015-02-18 23:25:54 -0500 | [diff] [blame] | 25 | MAINTAINER Apache Thrift <dev@thrift.apache.org> |
jfarrell | e03f7e8 | 2015-02-18 23:25:54 -0500 | [diff] [blame] | 26 | ENV DEBIAN_FRONTEND noninteractive |
| 27 | |
Robert Lu | 31d5b7b | 2018-01-05 13:44:38 +0800 | [diff] [blame] | 28 | ### Add apt repos |
| 29 | |
Robert Lu | a15060a | 2017-12-28 15:29:39 +0800 | [diff] [blame] | 30 | RUN apt-get update && \ |
| 31 | apt-get dist-upgrade -y && \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 32 | apt-get install -y --no-install-recommends \ |
| 33 | apt \ |
| 34 | apt-transport-https \ |
| 35 | apt-utils \ |
| 36 | curl \ |
| 37 | dirmngr \ |
| 38 | software-properties-common \ |
| 39 | wget |
Nobuaki Sukegawa | 7be78ea | 2016-05-15 00:25:04 +0900 | [diff] [blame] | 40 | |
Robert Lu | 31d5b7b | 2018-01-05 13:44:38 +0800 | [diff] [blame] | 41 | # D |
| 42 | RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EBCF975E5BA24D5E && \ |
| 43 | wget http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list && \ |
| 44 | wget -qO - https://dlang.org/d-keyring.gpg | apt-key add - |
| 45 | |
| 46 | # Dart |
| 47 | RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ |
| 48 | curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > \ |
| 49 | /etc/apt/sources.list.d/dart_stable.list |
| 50 | |
Nobuaki Sukegawa | 6bb1277 | 2016-03-08 01:55:31 +0900 | [diff] [blame] | 51 | RUN apt-get update && apt-get install -y --no-install-recommends \ |
Nobuaki Sukegawa | 7be78ea | 2016-05-15 00:25:04 +0900 | [diff] [blame] | 52 | `# General dependencies` \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 53 | bash-completion \ |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 54 | bison \ |
Nobuaki Sukegawa | 6bb1277 | 2016-03-08 01:55:31 +0900 | [diff] [blame] | 55 | build-essential \ |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 56 | clang \ |
| 57 | cmake \ |
| 58 | debhelper \ |
| 59 | flex \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 60 | gdb \ |
| 61 | llvm \ |
Nobuaki Sukegawa | 6bb1277 | 2016-03-08 01:55:31 +0900 | [diff] [blame] | 62 | ninja-build \ |
Nobuaki Sukegawa | 7be78ea | 2016-05-15 00:25:04 +0900 | [diff] [blame] | 63 | pkg-config \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 64 | valgrind \ |
| 65 | vim |
| 66 | ENV PATH /usr/lib/llvm-3.8/bin:$PATH |
jfarrell | e03f7e8 | 2015-02-18 23:25:54 -0500 | [diff] [blame] | 67 | |
James E. King, III | 43e959b | 2017-04-04 13:04:29 -0400 | [diff] [blame] | 68 | RUN apt-get install -y --no-install-recommends \ |
Nobuaki Sukegawa | 7be78ea | 2016-05-15 00:25:04 +0900 | [diff] [blame] | 69 | `# C++ dependencies` \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 70 | libboost-all-dev \ |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 71 | libevent-dev \ |
Nobuaki Sukegawa | 6bb1277 | 2016-03-08 01:55:31 +0900 | [diff] [blame] | 72 | libssl-dev \ |
| 73 | qt5-default \ |
| 74 | qtbase5-dev \ |
| 75 | qtbase5-dev-tools |
jfarrell | e03f7e8 | 2015-02-18 23:25:54 -0500 | [diff] [blame] | 76 | |
James E. King, III | 43e959b | 2017-04-04 13:04:29 -0400 | [diff] [blame] | 77 | RUN apt-get install -y --no-install-recommends \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 78 | `# csharp (mono) dependencies` \ |
| 79 | mono-devel |
| 80 | |
Robert Lu | 31d5b7b | 2018-01-05 13:44:38 +0800 | [diff] [blame] | 81 | RUN apt-get install -y --no-install-recommends \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 82 | `# D dependencies` \ |
| 83 | dmd-bin=2.070.2-0 \ |
| 84 | libphobos2-dev=2.070.2-0 \ |
| 85 | dub \ |
| 86 | dfmt \ |
| 87 | dscanner \ |
| 88 | xdg-utils |
| 89 | # RUN mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \ |
| 90 | # curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \ |
| 91 | # mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \ |
| 92 | # mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \ |
| 93 | # rm -rf libevent-master |
| 94 | # RUN curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \ |
| 95 | # mv openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \ |
| 96 | # mv openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \ |
| 97 | # rm -rf openssl-master |
| 98 | |
Robert Lu | 31d5b7b | 2018-01-05 13:44:38 +0800 | [diff] [blame] | 99 | RUN apt-get install -y --no-install-recommends \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 100 | `# Dart dependencies` \ |
| 101 | dart=1.20.1-1 |
| 102 | ENV PATH /usr/lib/dart/bin:$PATH |
| 103 | |
| 104 | RUN apt-get install -y --no-install-recommends \ |
| 105 | `# Erlang dependencies` \ |
| 106 | erlang-base \ |
| 107 | erlang-eunit \ |
| 108 | erlang-dev \ |
| 109 | erlang-tools \ |
| 110 | rebar |
| 111 | |
| 112 | RUN apt-get install -y --no-install-recommends \ |
| 113 | `# GlibC dependencies` \ |
| 114 | libglib2.0-dev |
| 115 | |
| 116 | RUN apt-get install -y --no-install-recommends \ |
| 117 | `# golang (go) dependencies` \ |
| 118 | golang-go |
| 119 | |
| 120 | RUN apt-get install -y --no-install-recommends \ |
| 121 | `# Haskell dependencies` \ |
| 122 | ghc \ |
| 123 | cabal-install |
| 124 | |
| 125 | # disabled because it cores while installing |
| 126 | # RUN apt-get install -y --no-install-recommends \ |
| 127 | # `# Haxe dependencies` \ |
| 128 | # haxe \ |
| 129 | # neko \ |
| 130 | # neko-dev && \ |
| 131 | # haxelib setup /usr/share/haxe/lib && \ |
| 132 | # haxelib install hxcpp 3.2.102 |
| 133 | |
| 134 | RUN apt-get install -y --no-install-recommends \ |
Nobuaki Sukegawa | 7be78ea | 2016-05-15 00:25:04 +0900 | [diff] [blame] | 135 | `# Java dependencies` \ |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 136 | ant \ |
Nobuaki Sukegawa | 6bb1277 | 2016-03-08 01:55:31 +0900 | [diff] [blame] | 137 | ant-optional \ |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 138 | openjdk-7-jdk \ |
Nobuaki Sukegawa | 7be78ea | 2016-05-15 00:25:04 +0900 | [diff] [blame] | 139 | maven |
jfarrell | e03f7e8 | 2015-02-18 23:25:54 -0500 | [diff] [blame] | 140 | |
James E. King, III | 43e959b | 2017-04-04 13:04:29 -0400 | [diff] [blame] | 141 | RUN apt-get install -y --no-install-recommends \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 142 | `# Lua dependencies` \ |
| 143 | lua5.1 \ |
| 144 | lua5.1-dev |
| 145 | |
| 146 | # disabled because it is too old |
| 147 | # RUN apt-get install -y --no-install-recommends \ |
| 148 | # `# Node.js dependencies` \ |
| 149 | # nodejs \ |
| 150 | # npm |
| 151 | |
| 152 | # disabled because it fails to install properly |
| 153 | # RUN apt-get install -y --no-install-recommends \ |
| 154 | # `# OCaml dependencies` \ |
| 155 | # ocaml \ |
| 156 | # opam && \ |
| 157 | # opam init --yes && \ |
| 158 | # opam install --yes oasis |
jfarrell | e03f7e8 | 2015-02-18 23:25:54 -0500 | [diff] [blame] | 159 | |
James E. King, III | 43e959b | 2017-04-04 13:04:29 -0400 | [diff] [blame] | 160 | RUN apt-get install -y --no-install-recommends \ |
Nobuaki Sukegawa | 7be78ea | 2016-05-15 00:25:04 +0900 | [diff] [blame] | 161 | `# Perl dependencies` \ |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 162 | libbit-vector-perl \ |
| 163 | libclass-accessor-class-perl \ |
| 164 | libcrypt-ssleay-perl \ |
| 165 | libio-socket-ssl-perl \ |
| 166 | libnet-ssleay-perl |
jfarrell | e03f7e8 | 2015-02-18 23:25:54 -0500 | [diff] [blame] | 167 | |
James E. King, III | 43e959b | 2017-04-04 13:04:29 -0400 | [diff] [blame] | 168 | RUN apt-get install -y --no-install-recommends \ |
Nobuaki Sukegawa | 7be78ea | 2016-05-15 00:25:04 +0900 | [diff] [blame] | 169 | `# Php dependencies` \ |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 170 | php5 \ |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 171 | php5-cli \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 172 | php5-dev \ |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 173 | php-pear \ |
Robert Lu | a15060a | 2017-12-28 15:29:39 +0800 | [diff] [blame] | 174 | re2c && \ |
| 175 | wget https://getcomposer.org/installer -O - -q | php -- --quiet --install-dir=/usr/local/bin/ --filename=composer |
jfarrell | e03f7e8 | 2015-02-18 23:25:54 -0500 | [diff] [blame] | 176 | |
James E. King, III | 43e959b | 2017-04-04 13:04:29 -0400 | [diff] [blame] | 177 | RUN apt-get install -y --no-install-recommends \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 178 | `# Python dependencies` \ |
| 179 | python-all \ |
| 180 | python-all-dbg \ |
| 181 | python-all-dev \ |
| 182 | python-pip \ |
| 183 | python-setuptools \ |
| 184 | python-six \ |
| 185 | python-twisted \ |
| 186 | python-wheel \ |
| 187 | python-zope.interface \ |
| 188 | python3-all \ |
| 189 | python3-all-dbg \ |
| 190 | python3-all-dev \ |
| 191 | python3-pip \ |
| 192 | python3-setuptools \ |
| 193 | python3-six \ |
| 194 | python3-wheel \ |
| 195 | python3-zope.interface && \ |
| 196 | pip install -U ipaddress backports.ssl_match_hostname tornado && \ |
Robert Lu | a15060a | 2017-12-28 15:29:39 +0800 | [diff] [blame] | 197 | pip3 install -U backports.ssl_match_hostname tornado |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 198 | # installing tornado by pip/pip3 instead of debian package |
| 199 | # if we install the debian package, the build fails in py2 |
Nobuaki Sukegawa | 7be78ea | 2016-05-15 00:25:04 +0900 | [diff] [blame] | 200 | |
James E. King, III | 43e959b | 2017-04-04 13:04:29 -0400 | [diff] [blame] | 201 | RUN apt-get install -y --no-install-recommends \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 202 | `# Ruby dependencies` \ |
| 203 | ruby \ |
| 204 | ruby-dev \ |
| 205 | ruby-bundler |
| 206 | RUN gem install bundler --no-ri --no-rdoc |
| 207 | |
| 208 | RUN apt-get install -y --no-install-recommends \ |
| 209 | `# Rust dependencies` \ |
| 210 | cargo \ |
| 211 | rustc |
| 212 | |
| 213 | RUN apt-get install -y --no-install-recommends \ |
| 214 | `# Static Code Analysis dependencies` \ |
| 215 | cppcheck \ |
| 216 | sloccount && \ |
| 217 | pip install flake8 |
| 218 | |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 219 | # Install BouncyCastle provider to fix Java builds issues with JDK 7 |
| 220 | # Builds accessing repote repositories fail as seen here: https://github.com/travis-ci/travis-ci/issues/8503 |
| 221 | RUN apt-get install -y --no-install-recommends \ |
| 222 | `# BouncyCastle JCE Provider dependencies` \ |
| 223 | libbcprov-java && \ |
| 224 | ln -s /usr/share/java/bcprov.jar /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext/bcprov.jar && \ |
| 225 | awk -F . -v OFS=. 'BEGIN{n=2}/^security\.provider/ {split($3, posAndEquals, "=");$3=n++"="posAndEquals[2];print;next} 1' /etc/java-7-openjdk/security/java.security > /tmp/java.security && \ |
| 226 | echo "security.provider.1=org.bouncycastle.jce.provider.BouncyCastleProvider" >> /tmp/java.security && \ |
| 227 | mv /tmp/java.security /etc/java-7-openjdk/security/java.security |
| 228 | |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 229 | # Clean up |
| 230 | RUN rm -rf /var/cache/apt/* && \ |
Nobuaki Sukegawa | 7be78ea | 2016-05-15 00:25:04 +0900 | [diff] [blame] | 231 | rm -rf /var/lib/apt/lists/* && \ |
| 232 | rm -rf /tmp/* && \ |
| 233 | rm -rf /var/tmp/* |
| 234 | |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 235 | ENV THRIFT_ROOT /thrift |
| 236 | RUN mkdir -p $THRIFT_ROOT/src |
Nobuaki Sukegawa | 93fb7ea | 2016-09-04 17:00:11 +0900 | [diff] [blame] | 237 | COPY Dockerfile $THRIFT_ROOT/ |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 238 | WORKDIR $THRIFT_ROOT/src |