James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [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 | |
| 13 | # |
| 14 | # Apache Thrift Docker build environment for Ubuntu Artful |
| 15 | # Using all stock Ubuntu Artful packaging except for: |
| 16 | # - cpp: stock boost 1.62 in artful has a nasty bug so we use stock boost 1.63 |
| 17 | # - d: does not come with Ubuntu so we're installing the latest |
| 18 | # - d: deimos for libevent and openssl omitted - not compatible / build errors |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 19 | # - haxe: see THRIFT-4352, but test/haxe cores during testing |
| 20 | # and hxcpp 3.4.64 is not compatible with artful |
| 21 | # |
| 22 | |
| 23 | FROM buildpack-deps:artful-scm |
| 24 | MAINTAINER Apache Thrift <dev@thrift.apache.org> |
| 25 | ENV DEBIAN_FRONTEND noninteractive |
| 26 | |
Robert Lu | 31d5b7b | 2018-01-05 13:44:38 +0800 | [diff] [blame] | 27 | ### Add apt repos |
| 28 | |
Robert Lu | a15060a | 2017-12-28 15:29:39 +0800 | [diff] [blame] | 29 | RUN apt-get update && \ |
| 30 | apt-get dist-upgrade -y && \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 31 | apt-get install -y --no-install-recommends \ |
| 32 | apt \ |
| 33 | apt-transport-https \ |
| 34 | apt-utils \ |
| 35 | curl \ |
| 36 | dirmngr \ |
| 37 | software-properties-common \ |
| 38 | wget |
| 39 | |
| 40 | # csharp (mono) - if we ever want a later version |
| 41 | # RUN echo "deb http://download.mono-project.com/repo/debian xenial main" | tee /etc/apt/sources.list.d/mono.list && \ |
| 42 | # apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A6A19B38D3D831EF |
| 43 | |
James E. King, III | 6e883f9 | 2017-11-18 21:18:05 -0500 | [diff] [blame] | 44 | # dotnet (core) |
| 45 | RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \ |
Robert Lu | 31d5b7b | 2018-01-05 13:44:38 +0800 | [diff] [blame] | 46 | echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-artful-prod artful main" > \ |
| 47 | /etc/apt/sources.list.d/dotnetdev.list |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 48 | |
Robert Lu | 31d5b7b | 2018-01-05 13:44:38 +0800 | [diff] [blame] | 49 | # node.js |
| 50 | RUN curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ |
| 51 | echo "deb https://deb.nodesource.com/node_8.x artful main" | tee /etc/apt/sources.list.d/nodesource.list |
| 52 | |
| 53 | # D |
| 54 | RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EBCF975E5BA24D5E && \ |
| 55 | wget http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list && \ |
| 56 | wget -qO - https://dlang.org/d-keyring.gpg | apt-key add - |
| 57 | |
| 58 | # Dart |
| 59 | RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ |
| 60 | curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > \ |
| 61 | /etc/apt/sources.list.d/dart_stable.list |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 62 | |
| 63 | ### install general dependencies |
Robert Lu | 31d5b7b | 2018-01-05 13:44:38 +0800 | [diff] [blame] | 64 | RUN apt-get update && apt-get install -y --no-install-recommends \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 65 | `# General dependencies` \ |
| 66 | bash-completion \ |
| 67 | bison \ |
| 68 | build-essential \ |
| 69 | clang \ |
| 70 | cmake \ |
| 71 | debhelper \ |
| 72 | flex \ |
| 73 | gdb \ |
| 74 | llvm \ |
| 75 | ninja-build \ |
| 76 | pkg-config \ |
| 77 | valgrind \ |
| 78 | vim |
| 79 | ENV PATH /usr/lib/llvm-3.8/bin:$PATH |
| 80 | |
| 81 | # boost-1.62 has a terrible bug in boost::test, see https://svn.boost.org/trac10/ticket/12507 |
| 82 | RUN apt-get install -y --no-install-recommends \ |
| 83 | `# C++ dependencies` \ |
| 84 | libboost1.63-all-dev \ |
| 85 | libevent-dev \ |
| 86 | libssl-dev \ |
| 87 | qt5-default \ |
| 88 | qtbase5-dev \ |
| 89 | qtbase5-dev-tools |
| 90 | |
| 91 | RUN apt-get install -y --no-install-recommends \ |
| 92 | `# csharp (mono) dependencies` \ |
| 93 | mono-devel |
| 94 | |
James E. King III | f338d57 | 2018-01-29 14:51:24 -0500 | [diff] [blame] | 95 | ENV D_VERSION 2.077.1-0.1 |
Robert Lu | 31d5b7b | 2018-01-05 13:44:38 +0800 | [diff] [blame] | 96 | RUN apt-get install -y --no-install-recommends \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 97 | `# D dependencies` \ |
James E. King III | f338d57 | 2018-01-29 14:51:24 -0500 | [diff] [blame] | 98 | dmd-bin=$D_VERSION \ |
| 99 | libphobos2-dev=$D_VERSION \ |
| 100 | dmd-compiler=$D_VERSION \ |
| 101 | dmd-tools=$D_VERSION \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 102 | dub \ |
| 103 | dfmt \ |
| 104 | dscanner \ |
| 105 | libevent-dev \ |
| 106 | libssl-dev \ |
| 107 | xdg-utils |
James E. King III | f338d57 | 2018-01-29 14:51:24 -0500 | [diff] [blame] | 108 | RUN mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \ |
| 109 | curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \ |
| 110 | mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \ |
| 111 | mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \ |
| 112 | rm -rf libevent-master |
| 113 | RUN curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \ |
| 114 | mv openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \ |
| 115 | mv openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \ |
| 116 | rm -rf openssl-master |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 117 | |
Robert Lu | 31d5b7b | 2018-01-05 13:44:38 +0800 | [diff] [blame] | 118 | RUN apt-get install -y --no-install-recommends \ |
Robert Lu | c72d8dc | 2017-12-29 04:14:38 +0800 | [diff] [blame] | 119 | `# Dart dependencies` \ |
| 120 | dart/stable |
James E. King, III | 6e883f9 | 2017-11-18 21:18:05 -0500 | [diff] [blame] | 121 | ENV PATH /usr/lib/dart/bin:$PATH |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 122 | |
James E. King, III | 6e883f9 | 2017-11-18 21:18:05 -0500 | [diff] [blame] | 123 | RUN apt-get install -y --no-install-recommends \ |
| 124 | `# dotnet core dependencies` \ |
James E. King III | f338d57 | 2018-01-29 14:51:24 -0500 | [diff] [blame] | 125 | dotnet-sdk-2.1.4 |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 126 | |
| 127 | RUN apt-get install -y --no-install-recommends \ |
| 128 | `# Erlang dependencies` \ |
| 129 | erlang-base \ |
| 130 | erlang-eunit \ |
| 131 | erlang-dev \ |
| 132 | erlang-tools \ |
| 133 | rebar |
| 134 | |
| 135 | RUN apt-get install -y --no-install-recommends \ |
| 136 | `# GlibC dependencies` \ |
| 137 | libglib2.0-dev |
| 138 | |
| 139 | RUN apt-get install -y --no-install-recommends \ |
| 140 | `# golang (go) dependencies` \ |
| 141 | golang-go \ |
| 142 | golang-race-detector-runtime |
| 143 | |
| 144 | RUN apt-get install -y --no-install-recommends \ |
| 145 | `# Haskell dependencies` \ |
| 146 | ghc \ |
| 147 | cabal-install |
| 148 | |
| 149 | # see THRIFT-4352, test/haxe cores on artful |
| 150 | # RUN apt-get install -y --no-install-recommends \ |
| 151 | # `# Haxe dependencies` \ |
| 152 | # haxe \ |
| 153 | # neko \ |
| 154 | # neko-dev |
| 155 | # RUN haxelib setup --always /usr/share/haxe/lib && \ |
James E. King III | f64a3fc | 2018-01-14 08:54:25 -0500 | [diff] [blame] | 156 | # haxelib install --always hxcpp 2>&1 > /dev/null |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 157 | |
| 158 | RUN apt-get install -y --no-install-recommends \ |
| 159 | `# Java dependencies` \ |
| 160 | ant \ |
| 161 | ant-optional \ |
| 162 | openjdk-8-jdk \ |
| 163 | maven |
| 164 | |
| 165 | RUN apt-get install -y --no-install-recommends \ |
| 166 | `# Lua dependencies` \ |
James E. King, III | 39eaae6 | 2017-11-19 20:17:33 -0500 | [diff] [blame] | 167 | lua5.2 \ |
| 168 | lua5.2-dev |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 169 | # https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212 |
| 170 | # lua5.3 does not install alternatives! |
James E. King, III | 39eaae6 | 2017-11-19 20:17:33 -0500 | [diff] [blame] | 171 | # need to update our luasocket code, lua doesn't have luaL_openlib any more |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 172 | |
| 173 | RUN apt-get install -y --no-install-recommends \ |
| 174 | `# Node.js dependencies` \ |
James E. King, III | 619218c | 2017-10-29 06:55:00 -0400 | [diff] [blame] | 175 | nodejs |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 176 | |
| 177 | RUN apt-get install -y --no-install-recommends \ |
| 178 | `# OCaml dependencies` \ |
| 179 | ocaml \ |
| 180 | opam && \ |
| 181 | opam init --yes && \ |
| 182 | opam install --yes oasis |
| 183 | |
| 184 | RUN apt-get install -y --no-install-recommends \ |
| 185 | `# Perl dependencies` \ |
| 186 | libbit-vector-perl \ |
| 187 | libclass-accessor-class-perl \ |
| 188 | libcrypt-ssleay-perl \ |
| 189 | libio-socket-ssl-perl \ |
| 190 | libnet-ssleay-perl |
| 191 | |
| 192 | RUN apt-get install -y --no-install-recommends \ |
| 193 | `# Php dependencies` \ |
| 194 | php \ |
| 195 | php-cli \ |
| 196 | php-dev \ |
| 197 | php-pear \ |
| 198 | re2c \ |
Robert Lu | a15060a | 2017-12-28 15:29:39 +0800 | [diff] [blame] | 199 | composer |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 200 | |
| 201 | RUN apt-get install -y --no-install-recommends \ |
| 202 | `# Python dependencies` \ |
| 203 | python-all \ |
| 204 | python-all-dbg \ |
| 205 | python-all-dev \ |
| 206 | python-ipaddress \ |
| 207 | python-pip \ |
| 208 | python-setuptools \ |
| 209 | python-six \ |
| 210 | python-tornado \ |
| 211 | python-twisted \ |
| 212 | python-wheel \ |
| 213 | python-zope.interface && \ |
| 214 | pip install --upgrade backports.ssl_match_hostname |
| 215 | |
| 216 | RUN apt-get install -y --no-install-recommends \ |
| 217 | `# Python3 dependencies` \ |
| 218 | python3-all \ |
| 219 | python3-all-dbg \ |
| 220 | python3-all-dev \ |
| 221 | python3-pip \ |
| 222 | python3-setuptools \ |
| 223 | python3-six \ |
| 224 | python3-tornado \ |
| 225 | python3-twisted \ |
| 226 | python3-wheel \ |
| 227 | python3-zope.interface |
| 228 | |
| 229 | RUN apt-get install -y --no-install-recommends \ |
| 230 | `# Ruby dependencies` \ |
| 231 | ruby \ |
| 232 | ruby-dev \ |
| 233 | ruby-bundler |
| 234 | RUN gem install bundler --no-ri --no-rdoc |
| 235 | |
| 236 | RUN apt-get install -y --no-install-recommends \ |
| 237 | `# Rust dependencies` \ |
| 238 | cargo \ |
| 239 | rustc |
| 240 | |
| 241 | RUN apt-get install -y --no-install-recommends \ |
| 242 | `# Static Code Analysis dependencies` \ |
| 243 | cppcheck \ |
| 244 | sloccount && \ |
| 245 | pip install flake8 |
| 246 | |
| 247 | # Clean up |
| 248 | RUN rm -rf /var/cache/apt/* && \ |
| 249 | rm -rf /var/lib/apt/lists/* && \ |
| 250 | rm -rf /tmp/* && \ |
| 251 | rm -rf /var/tmp/* |
| 252 | |
| 253 | ENV THRIFT_ROOT /thrift |
| 254 | RUN mkdir -p $THRIFT_ROOT/src |
| 255 | COPY Dockerfile $THRIFT_ROOT/ |
| 256 | WORKDIR $THRIFT_ROOT/src |