James E. King, III | b66b66f | 2017-08-31 18:07:40 -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 | |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 13 | # |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 14 | # Apache Thrift Docker build environment for Ubuntu Xenial |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 15 | # Using all stock Ubuntu Xenial packaging except for: |
| 16 | # - d: does not come with Ubuntu so we're installing 2.073.2 for coverage |
| 17 | # - dart: does not come with Ubuntu so we're installing 1.22.1 for coverage |
| 18 | # |
| 19 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 20 | # |
| 21 | # Known missing or disabled libraries: |
| 22 | # - d: deimos for libevent and openssl omitted - not compatible / build errors |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 23 | |
| 24 | FROM buildpack-deps:xenial-scm |
| 25 | MAINTAINER Apache Thrift <dev@thrift.apache.org> |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 26 | ENV DEBIAN_FRONTEND noninteractive |
| 27 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 28 | ### Add apt repos |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 29 | |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 30 | RUN apt-get update && apt-get dist-upgrade -y && apt-get install -y --no-install-recommends apt apt-transport-https curl wget apt-utils |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 31 | |
James E. King, III | f454369 | 2017-09-01 05:23:29 -0700 | [diff] [blame] | 32 | # csharp (mono) |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 33 | # RUN echo "deb http://download.mono-project.com/repo/debian xenial main" | tee /etc/apt/sources.list.d/mono.list && \ |
| 34 | # apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A6A19B38D3D831EF |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 35 | |
| 36 | # D |
| 37 | RUN wget http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list && \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 38 | wget -qO - https://dlang.org/d-keyring.gpg | apt-key add - |
| 39 | ENV D_VERSION 2.073.2-0 |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 40 | |
| 41 | # Dart |
| 42 | RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ |
| 43 | curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list && \ |
| 44 | sed -i /etc/apt/sources.list.d/dart_stable.list -e 's/https:/http:/g' |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 45 | # since ubuntu-artful can't run dart, we'll run 1.240 on xenial for now |
| 46 | ENV DART_VERSION 1.24.2-1 |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 47 | |
James E. King, III | 6e883f9 | 2017-11-18 21:18:05 -0500 | [diff] [blame] | 48 | # dotnet (core) |
James E. King, III | b628736 | 2017-09-28 11:57:42 +0000 | [diff] [blame] | 49 | RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \ |
| 50 | echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > /etc/apt/sources.list.d/dotnetdev.list |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 51 | |
| 52 | # node.js (this step runs apt-get update internally) |
James E. King, III | 699b5bc | 2017-09-14 08:07:08 -0700 | [diff] [blame] | 53 | # note: node 8.5 introduced some issues with directory handling / jsdoc / something... using 7.x for now |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 54 | # RUN curl -sL https://deb.nodesource.com/setup_7.x | bash |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 55 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 56 | |
| 57 | ### install general dependencies |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 58 | RUN apt-get update && apt-get install -y --no-install-recommends \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 59 | `# General dependencies` \ |
James E. King, III | f454369 | 2017-09-01 05:23:29 -0700 | [diff] [blame] | 60 | bash-completion \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 61 | bison \ |
| 62 | build-essential \ |
| 63 | clang \ |
| 64 | cmake \ |
| 65 | debhelper \ |
| 66 | flex \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 67 | gdb \ |
| 68 | llvm \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 69 | ninja-build \ |
| 70 | pkg-config \ |
James E. King, III | 7d211b8 | 2017-09-06 10:12:02 -0700 | [diff] [blame] | 71 | valgrind \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 72 | vim |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 73 | ENV PATH /usr/lib/llvm-3.8/bin:$PATH |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 74 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 75 | ### languages |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 76 | |
| 77 | RUN apt-get install -y --no-install-recommends \ |
| 78 | `# C++ dependencies` \ |
| 79 | libboost-dev \ |
| 80 | libboost-filesystem-dev \ |
| 81 | libboost-program-options-dev \ |
| 82 | libboost-system-dev \ |
| 83 | libboost-test-dev \ |
| 84 | libboost-thread-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 \ |
James E. King, III | f454369 | 2017-09-01 05:23:29 -0700 | [diff] [blame] | 92 | `# csharp (mono) dependencies` \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 93 | mono-devel |
| 94 | |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 95 | RUN apt-get install -y --allow-unauthenticated --no-install-recommends \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 96 | `# D dependencies` \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 97 | dmd-bin=$D_VERSION \ |
| 98 | libphobos2-dev=$D_VERSION \ |
| 99 | dub \ |
| 100 | dfmt \ |
| 101 | dscanner \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 102 | libevent-dev \ |
| 103 | libssl-dev \ |
| 104 | xdg-utils |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 105 | # libevent deimos doesn't seem to work so not enabling it: |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 106 | # RUN mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \ |
| 107 | # curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \ |
| 108 | # mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \ |
| 109 | # mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \ |
| 110 | # rm -rf libevent-master |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 111 | # openssl deimos doesn't work with openssl-1.0.2 so not enabling it: |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 112 | # RUN curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \ |
| 113 | # mv openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \ |
| 114 | # mv openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \ |
| 115 | # rm -rf openssl-master |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 116 | |
| 117 | RUN apt-get install -y --no-install-recommends \ |
| 118 | `# Dart dependencies` \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 119 | dart=$DART_VERSION |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 120 | ENV PATH /usr/lib/dart/bin:$PATH |
| 121 | |
James E. King, III | b628736 | 2017-09-28 11:57:42 +0000 | [diff] [blame] | 122 | RUN apt-get install -y --no-install-recommends \ |
| 123 | `# dotnet core dependencies` \ |
James E. King, III | 6e883f9 | 2017-11-18 21:18:05 -0500 | [diff] [blame] | 124 | dotnet-sdk-2.0.3 |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 125 | |
| 126 | RUN apt-get install -y --no-install-recommends \ |
| 127 | `# Erlang dependencies` \ |
| 128 | erlang-base \ |
| 129 | erlang-eunit \ |
| 130 | erlang-dev \ |
| 131 | erlang-tools \ |
| 132 | rebar |
| 133 | |
| 134 | RUN apt-get install -y --no-install-recommends \ |
| 135 | `# GlibC dependencies` \ |
| 136 | libglib2.0-dev |
| 137 | |
| 138 | RUN apt-get install -y --no-install-recommends \ |
| 139 | `# golang (go) dependencies` \ |
James E. King, III | f454369 | 2017-09-01 05:23:29 -0700 | [diff] [blame] | 140 | golang-go \ |
| 141 | golang-race-detector-runtime |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 142 | |
| 143 | RUN apt-get install -y --no-install-recommends \ |
| 144 | `# Haskell dependencies` \ |
| 145 | ghc \ |
| 146 | cabal-install |
| 147 | |
| 148 | RUN apt-get install -y --no-install-recommends \ |
| 149 | `# Haxe dependencies` \ |
| 150 | haxe \ |
| 151 | neko \ |
| 152 | neko-dev \ |
| 153 | libneko0 |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 154 | RUN haxelib setup --always /usr/share/haxe/lib && \ |
James E. King, III | 81cdcd3 | 2017-09-09 17:54:10 +0000 | [diff] [blame] | 155 | haxelib install --always hxcpp 3.4.64 |
| 156 | # note: hxcpp 3.4.185 (latest) no longer ships static libraries, and caused a build failure |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -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 | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 167 | lua5.2 \ |
| 168 | lua5.2-dev |
| 169 | # https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212 |
| 170 | # lua5.3 does not install alternatives so stick with 5.2 here |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 171 | |
| 172 | RUN apt-get install -y --no-install-recommends \ |
| 173 | `# Node.js dependencies` \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 174 | nodejs \ |
| 175 | npm && \ |
| 176 | ln -s /usr/bin/nodejs /usr/bin/node |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 177 | |
| 178 | RUN apt-get install -y --no-install-recommends \ |
| 179 | `# OCaml dependencies` \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 180 | ocaml \ |
| 181 | opam && \ |
| 182 | opam init --yes && \ |
| 183 | opam install --yes oasis |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 184 | |
| 185 | RUN apt-get install -y --no-install-recommends \ |
| 186 | `# Perl dependencies` \ |
| 187 | libbit-vector-perl \ |
| 188 | libclass-accessor-class-perl \ |
| 189 | libcrypt-ssleay-perl \ |
| 190 | libio-socket-ssl-perl \ |
| 191 | libnet-ssleay-perl |
| 192 | |
| 193 | RUN apt-get install -y --no-install-recommends \ |
| 194 | `# Php dependencies` \ |
| 195 | php7.0 \ |
| 196 | php7.0-cli \ |
| 197 | php7.0-dev \ |
| 198 | php-pear \ |
| 199 | re2c \ |
| 200 | phpunit |
| 201 | |
| 202 | RUN apt-get install -y --no-install-recommends \ |
| 203 | `# Python dependencies` \ |
| 204 | python-all \ |
| 205 | python-all-dbg \ |
| 206 | python-all-dev \ |
| 207 | python-backports.ssl-match-hostname \ |
| 208 | python-ipaddress \ |
| 209 | python-pip \ |
| 210 | python-setuptools \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 211 | python-six \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 212 | python-tornado \ |
| 213 | python-twisted \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 214 | python-wheel \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 215 | python-zope.interface \ |
| 216 | python3-all \ |
| 217 | python3-all-dbg \ |
| 218 | python3-all-dev \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 219 | python3-setuptools \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 220 | python3-six \ |
| 221 | python3-tornado \ |
| 222 | python3-twisted \ |
| 223 | python3-wheel \ |
| 224 | python3-zope.interface && \ |
| 225 | pip install --upgrade backports.ssl_match_hostname |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 226 | |
| 227 | RUN apt-get install -y --no-install-recommends \ |
| 228 | `# Ruby dependencies` \ |
| 229 | ruby \ |
| 230 | ruby-dev \ |
| 231 | ruby-bundler |
| 232 | RUN gem install bundler --no-ri --no-rdoc |
| 233 | |
| 234 | RUN apt-get install -y --no-install-recommends \ |
| 235 | `# Rust dependencies` \ |
| 236 | cargo \ |
| 237 | rustc |
| 238 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 239 | # Clean up |
| 240 | RUN rm -rf /var/cache/apt/* && \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 241 | rm -rf /var/lib/apt/lists/* && \ |
| 242 | rm -rf /tmp/* && \ |
| 243 | rm -rf /var/tmp/* |
| 244 | |
James E. King, III | b628736 | 2017-09-28 11:57:42 +0000 | [diff] [blame] | 245 | ENV DOTNET_CLI_TELEMETRY_OPTOUT 1 |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 246 | ENV THRIFT_ROOT /thrift |
| 247 | RUN mkdir -p $THRIFT_ROOT/src |
| 248 | COPY Dockerfile $THRIFT_ROOT/ |
| 249 | WORKDIR $THRIFT_ROOT/src |