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 |
James E. King III | d907cc9 | 2018-01-12 10:43:25 -0500 | [diff] [blame] | 17 | # - d: dmd does not come with Ubuntu |
Brian Forbis | c64389a | 2018-09-22 07:36:24 -0400 | [diff] [blame^] | 18 | # - dart: does not come with Ubuntu. Pinned to last 1.x release |
James E. King III | d907cc9 | 2018-01-12 10:43:25 -0500 | [diff] [blame] | 19 | # - dotnet: does not come with Ubuntu |
| 20 | # - haxe: version 3.4.2 that comes with Ubuntu cores in our CI build |
Aki Sukegawa | b03d749 | 2018-06-08 11:39:34 +0900 | [diff] [blame] | 21 | # - go: artful comes with 1.9, we want the latest (supported) |
| 22 | # - nodejs: want v8, artful comes with v6 |
James E. King III | a37feaf | 2018-03-06 15:11:01 -0500 | [diff] [blame] | 23 | # |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 24 | |
| 25 | FROM buildpack-deps:artful-scm |
| 26 | MAINTAINER Apache Thrift <dev@thrift.apache.org> |
| 27 | ENV DEBIAN_FRONTEND noninteractive |
| 28 | |
Robert Lu | 31d5b7b | 2018-01-05 13:44:38 +0800 | [diff] [blame] | 29 | ### Add apt repos |
| 30 | |
Robert Lu | a15060a | 2017-12-28 15:29:39 +0800 | [diff] [blame] | 31 | RUN apt-get update && \ |
| 32 | apt-get dist-upgrade -y && \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 33 | apt-get install -y --no-install-recommends \ |
| 34 | apt \ |
| 35 | apt-transport-https \ |
| 36 | apt-utils \ |
| 37 | curl \ |
| 38 | dirmngr \ |
| 39 | software-properties-common \ |
| 40 | wget |
| 41 | |
| 42 | # csharp (mono) - if we ever want a later version |
| 43 | # RUN echo "deb http://download.mono-project.com/repo/debian xenial main" | tee /etc/apt/sources.list.d/mono.list && \ |
| 44 | # apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A6A19B38D3D831EF |
| 45 | |
Robert Lu | 31d5b7b | 2018-01-05 13:44:38 +0800 | [diff] [blame] | 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 |
Brian Forbis | c64389a | 2018-09-22 07:36:24 -0400 | [diff] [blame^] | 50 | ENV DART_VERSION 1.24.3-1 |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 51 | |
James E. King III | d907cc9 | 2018-01-12 10:43:25 -0500 | [diff] [blame] | 52 | # dotnet (netcore) |
| 53 | RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \ |
| 54 | echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-artful-prod artful main" > \ |
| 55 | /etc/apt/sources.list.d/dotnetdev.list |
| 56 | |
| 57 | # haxe (https://haxe.org/download/linux/) |
| 58 | RUN add-apt-repository ppa:haxe/releases -y |
| 59 | |
| 60 | # node.js |
James E. King III | 78755f5 | 2018-03-06 09:50:33 -0500 | [diff] [blame] | 61 | RUN curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \ |
James E. King III | d907cc9 | 2018-01-12 10:43:25 -0500 | [diff] [blame] | 62 | echo "deb https://deb.nodesource.com/node_8.x artful main" | tee /etc/apt/sources.list.d/nodesource.list |
| 63 | |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 64 | ### install general dependencies |
Robert Lu | 31d5b7b | 2018-01-05 13:44:38 +0800 | [diff] [blame] | 65 | 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] | 66 | `# General dependencies` \ |
| 67 | bash-completion \ |
| 68 | bison \ |
| 69 | build-essential \ |
| 70 | clang \ |
| 71 | cmake \ |
| 72 | debhelper \ |
| 73 | flex \ |
| 74 | gdb \ |
| 75 | llvm \ |
| 76 | ninja-build \ |
| 77 | pkg-config \ |
| 78 | valgrind \ |
| 79 | vim |
| 80 | ENV PATH /usr/lib/llvm-3.8/bin:$PATH |
| 81 | |
| 82 | # boost-1.62 has a terrible bug in boost::test, see https://svn.boost.org/trac10/ticket/12507 |
| 83 | RUN apt-get install -y --no-install-recommends \ |
| 84 | `# C++ dependencies` \ |
| 85 | libboost1.63-all-dev \ |
| 86 | libevent-dev \ |
| 87 | libssl-dev \ |
| 88 | qt5-default \ |
| 89 | qtbase5-dev \ |
| 90 | qtbase5-dev-tools |
| 91 | |
| 92 | RUN apt-get install -y --no-install-recommends \ |
| 93 | `# csharp (mono) dependencies` \ |
| 94 | mono-devel |
| 95 | |
James E. King III | 859a40c | 2018-03-19 08:16:51 -0400 | [diff] [blame] | 96 | ENV SBCL_VERSION 1.4.5 |
James E. King III | bf7f76b | 2018-02-28 17:11:05 -0500 | [diff] [blame] | 97 | RUN \ |
Tomek Kurcz | e93a901 | 2017-09-19 09:16:43 +0200 | [diff] [blame] | 98 | `# Common Lisp (sbcl) dependencies` \ |
James E. King III | bf7f76b | 2018-02-28 17:11:05 -0500 | [diff] [blame] | 99 | curl --version && \ |
| 100 | curl -O -J -L https://kent.dl.sourceforge.net/project/sbcl/sbcl/${SBCL_VERSION}/sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2 && \ |
| 101 | tar xjf sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2 && \ |
| 102 | cd sbcl-${SBCL_VERSION}-x86-64-linux && \ |
| 103 | ./install.sh && \ |
| 104 | sbcl --version && \ |
| 105 | rm -rf sbcl* |
Tomek Kurcz | e93a901 | 2017-09-19 09:16:43 +0200 | [diff] [blame] | 106 | |
Aki Sukegawa | b03d749 | 2018-06-08 11:39:34 +0900 | [diff] [blame] | 107 | ENV D_VERSION 2.080.0 |
| 108 | ENV DMD_DEB dmd_2.080.0-0_amd64.deb |
James E. King III | bf7f76b | 2018-02-28 17:11:05 -0500 | [diff] [blame] | 109 | RUN \ |
| 110 | `# D dependencies` \ |
| 111 | wget -q http://downloads.dlang.org/releases/2.x/${D_VERSION}/${DMD_DEB} && \ |
| 112 | dpkg --install ${DMD_DEB} && \ |
| 113 | rm -f ${DMD_DEB} && \ |
| 114 | mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \ |
James E. King III | f338d57 | 2018-01-29 14:51:24 -0500 | [diff] [blame] | 115 | curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \ |
| 116 | mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \ |
| 117 | mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \ |
James E. King III | bf7f76b | 2018-02-28 17:11:05 -0500 | [diff] [blame] | 118 | rm -rf libevent-master && \ |
| 119 | curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \ |
James E. King III | f338d57 | 2018-01-29 14:51:24 -0500 | [diff] [blame] | 120 | mv openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \ |
| 121 | mv openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \ |
| 122 | rm -rf openssl-master |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 123 | |
Robert Lu | 31d5b7b | 2018-01-05 13:44:38 +0800 | [diff] [blame] | 124 | RUN apt-get install -y --no-install-recommends \ |
Robert Lu | c72d8dc | 2017-12-29 04:14:38 +0800 | [diff] [blame] | 125 | `# Dart dependencies` \ |
Brian Forbis | c64389a | 2018-09-22 07:36:24 -0400 | [diff] [blame^] | 126 | dart=$DART_VERSION |
James E. King, III | 6e883f9 | 2017-11-18 21:18:05 -0500 | [diff] [blame] | 127 | ENV PATH /usr/lib/dart/bin:$PATH |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 128 | |
James E. King, III | 6e883f9 | 2017-11-18 21:18:05 -0500 | [diff] [blame] | 129 | RUN apt-get install -y --no-install-recommends \ |
| 130 | `# dotnet core dependencies` \ |
James E. King III | f338d57 | 2018-01-29 14:51:24 -0500 | [diff] [blame] | 131 | dotnet-sdk-2.1.4 |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 132 | |
| 133 | RUN apt-get install -y --no-install-recommends \ |
| 134 | `# Erlang dependencies` \ |
| 135 | erlang-base \ |
| 136 | erlang-eunit \ |
| 137 | erlang-dev \ |
| 138 | erlang-tools \ |
| 139 | rebar |
| 140 | |
| 141 | RUN apt-get install -y --no-install-recommends \ |
| 142 | `# GlibC dependencies` \ |
| 143 | libglib2.0-dev |
| 144 | |
John Boiles | 5785279 | 2018-01-05 14:37:05 -0800 | [diff] [blame] | 145 | # golang |
D. Can Celasun | a9efd1a | 2018-03-15 12:52:37 +0100 | [diff] [blame] | 146 | ENV GOLANG_VERSION 1.10 |
John Boiles | 5785279 | 2018-01-05 14:37:05 -0800 | [diff] [blame] | 147 | ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz |
D. Can Celasun | a9efd1a | 2018-03-15 12:52:37 +0100 | [diff] [blame] | 148 | ENV GOLANG_DOWNLOAD_SHA256 b5a64335f1490277b585832d1f6c7f8c6c11206cba5cd3f771dcb87b98ad1a33 |
John Boiles | 5785279 | 2018-01-05 14:37:05 -0800 | [diff] [blame] | 149 | RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \ |
| 150 | echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \ |
| 151 | tar -C /usr/local -xzf golang.tar.gz && \ |
| 152 | ln -s /usr/local/go/bin/go /usr/local/bin && \ |
| 153 | rm golang.tar.gz |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 154 | |
| 155 | RUN apt-get install -y --no-install-recommends \ |
| 156 | `# Haskell dependencies` \ |
| 157 | ghc \ |
| 158 | cabal-install |
| 159 | |
James E. King III | d907cc9 | 2018-01-12 10:43:25 -0500 | [diff] [blame] | 160 | RUN apt-get install -y --no-install-recommends \ |
| 161 | `# Haxe dependencies` \ |
| 162 | haxe \ |
| 163 | neko \ |
| 164 | neko-dev && \ |
| 165 | haxelib setup --always /usr/share/haxe/lib && \ |
| 166 | haxelib install --always hxcpp 2>&1 > /dev/null |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 167 | |
| 168 | RUN apt-get install -y --no-install-recommends \ |
| 169 | `# Java dependencies` \ |
| 170 | ant \ |
| 171 | ant-optional \ |
| 172 | openjdk-8-jdk \ |
| 173 | maven |
| 174 | |
| 175 | RUN apt-get install -y --no-install-recommends \ |
| 176 | `# Lua dependencies` \ |
James E. King, III | 39eaae6 | 2017-11-19 20:17:33 -0500 | [diff] [blame] | 177 | lua5.2 \ |
| 178 | lua5.2-dev |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 179 | # https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212 |
| 180 | # lua5.3 does not install alternatives! |
James E. King, III | 39eaae6 | 2017-11-19 20:17:33 -0500 | [diff] [blame] | 181 | # 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] | 182 | |
| 183 | RUN apt-get install -y --no-install-recommends \ |
| 184 | `# Node.js dependencies` \ |
James E. King, III | 619218c | 2017-10-29 06:55:00 -0400 | [diff] [blame] | 185 | nodejs |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 186 | |
Brian Forbis | b5d6ea3 | 2018-08-25 23:39:29 -0400 | [diff] [blame] | 187 | # Test dependencies for running puppeteer |
| 188 | RUN apt-get install -y --no-install-recommends \ |
| 189 | `# JS dependencies` \ |
| 190 | libxss1 |
| 191 | |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 192 | RUN apt-get install -y --no-install-recommends \ |
| 193 | `# OCaml dependencies` \ |
| 194 | ocaml \ |
| 195 | opam && \ |
| 196 | opam init --yes && \ |
| 197 | opam install --yes oasis |
| 198 | |
| 199 | RUN apt-get install -y --no-install-recommends \ |
| 200 | `# Perl dependencies` \ |
| 201 | libbit-vector-perl \ |
| 202 | libclass-accessor-class-perl \ |
| 203 | libcrypt-ssleay-perl \ |
| 204 | libio-socket-ssl-perl \ |
| 205 | libnet-ssleay-perl |
| 206 | |
| 207 | RUN apt-get install -y --no-install-recommends \ |
| 208 | `# Php dependencies` \ |
| 209 | php \ |
| 210 | php-cli \ |
| 211 | php-dev \ |
| 212 | php-pear \ |
| 213 | re2c \ |
Robert Lu | a15060a | 2017-12-28 15:29:39 +0800 | [diff] [blame] | 214 | composer |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 215 | |
| 216 | RUN apt-get install -y --no-install-recommends \ |
| 217 | `# Python dependencies` \ |
| 218 | python-all \ |
| 219 | python-all-dbg \ |
| 220 | python-all-dev \ |
| 221 | python-ipaddress \ |
| 222 | python-pip \ |
| 223 | python-setuptools \ |
| 224 | python-six \ |
| 225 | python-tornado \ |
| 226 | python-twisted \ |
| 227 | python-wheel \ |
| 228 | python-zope.interface && \ |
| 229 | pip install --upgrade backports.ssl_match_hostname |
| 230 | |
| 231 | RUN apt-get install -y --no-install-recommends \ |
| 232 | `# Python3 dependencies` \ |
| 233 | python3-all \ |
| 234 | python3-all-dbg \ |
| 235 | python3-all-dev \ |
| 236 | python3-pip \ |
| 237 | python3-setuptools \ |
| 238 | python3-six \ |
| 239 | python3-tornado \ |
| 240 | python3-twisted \ |
| 241 | python3-wheel \ |
| 242 | python3-zope.interface |
| 243 | |
| 244 | RUN apt-get install -y --no-install-recommends \ |
| 245 | `# Ruby dependencies` \ |
| 246 | ruby \ |
| 247 | ruby-dev \ |
| 248 | ruby-bundler |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 249 | |
| 250 | RUN apt-get install -y --no-install-recommends \ |
| 251 | `# Rust dependencies` \ |
| 252 | cargo \ |
| 253 | rustc |
| 254 | |
| 255 | RUN apt-get install -y --no-install-recommends \ |
| 256 | `# Static Code Analysis dependencies` \ |
| 257 | cppcheck \ |
| 258 | sloccount && \ |
| 259 | pip install flake8 |
| 260 | |
| 261 | # Clean up |
| 262 | RUN rm -rf /var/cache/apt/* && \ |
| 263 | rm -rf /var/lib/apt/lists/* && \ |
| 264 | rm -rf /tmp/* && \ |
| 265 | rm -rf /var/tmp/* |
| 266 | |
| 267 | ENV THRIFT_ROOT /thrift |
| 268 | RUN mkdir -p $THRIFT_ROOT/src |
| 269 | COPY Dockerfile $THRIFT_ROOT/ |
| 270 | WORKDIR $THRIFT_ROOT/src |