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: |
James E. King III | b92ca5f | 2018-06-09 23:02:12 -0400 | [diff] [blame] | 16 | # - d: does not come with Ubuntu so we're installing 2.075.1 for coverage |
James E. King III | 93ff9b0 | 2019-06-21 17:50:34 -0400 | [diff] [blame] | 17 | # - dart: does not come with Ubuntu so we're installing 2.0.0-1 for coverage |
John Boiles | 5785279 | 2018-01-05 14:37:05 -0800 | [diff] [blame] | 18 | # - dotnet: does not come with Ubuntu |
James E. King III | 3b77982 | 2019-03-15 15:59:27 -0400 | [diff] [blame] | 19 | # - go: Xenial comes with 1.6, but we need 1.10 or later |
Mario Emmenlauer | 55680af | 2020-05-11 22:58:48 +0200 | [diff] [blame] | 20 | # - nodejs: Xenial comes with 4.2.6 which exits LTS April 2018, so we're installing 10.x |
James E. King III | a02ae56 | 2018-03-12 15:27:23 -0400 | [diff] [blame] | 21 | # - ocaml: causes stack overflow error, just started March 2018 not sure why |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 22 | # |
| 23 | |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 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 | |
Robert Lu | 31d5b7b | 2018-01-05 13:44:38 +0800 | [diff] [blame] | 30 | RUN apt-get update && \ |
| 31 | apt-get dist-upgrade -y && \ |
| 32 | apt-get install -y --no-install-recommends \ |
| 33 | apt \ |
| 34 | apt-transport-https \ |
| 35 | apt-utils \ |
| 36 | curl \ |
James E. King III | ad23852 | 2018-01-13 19:52:31 -0500 | [diff] [blame] | 37 | software-properties-common \ |
James E. King III | 93ff9b0 | 2019-06-21 17:50:34 -0400 | [diff] [blame] | 38 | wget && \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 39 | |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 40 | # D |
James E. King III | 93ff9b0 | 2019-06-21 17:50:34 -0400 | [diff] [blame] | 41 | apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EBCF975E5BA24D5E && \ |
James E. King III | ad23852 | 2018-01-13 19:52:31 -0500 | [diff] [blame] | 42 | 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 | 93ff9b0 | 2019-06-21 17:50:34 -0400 | [diff] [blame] | 43 | wget -qO - https://dlang.org/d-keyring.gpg | apt-key add - && \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 44 | |
| 45 | # Dart |
James E. King III | 93ff9b0 | 2019-06-21 17:50:34 -0400 | [diff] [blame] | 46 | curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ |
Robert Lu | 31d5b7b | 2018-01-05 13:44:38 +0800 | [diff] [blame] | 47 | curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > \ |
James E. King III | 93ff9b0 | 2019-06-21 17:50:34 -0400 | [diff] [blame] | 48 | /etc/apt/sources.list.d/dart_stable.list && \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 49 | |
James E. King, III | 6e883f9 | 2017-11-18 21:18:05 -0500 | [diff] [blame] | 50 | # dotnet (core) |
James E. King III | 93ff9b0 | 2019-06-21 17:50:34 -0400 | [diff] [blame] | 51 | 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] | 52 | echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > \ |
James E. King III | 93ff9b0 | 2019-06-21 17:50:34 -0400 | [diff] [blame] | 53 | /etc/apt/sources.list.d/dotnetdev.list && \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 54 | |
James E. King III | a37feaf | 2018-03-06 15:11:01 -0500 | [diff] [blame] | 55 | # node.js |
James E. King III | 93ff9b0 | 2019-06-21 17:50:34 -0400 | [diff] [blame] | 56 | curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \ |
Mario Emmenlauer | 55680af | 2020-05-11 22:58:48 +0200 | [diff] [blame] | 57 | echo "deb https://deb.nodesource.com/node_10.x xenial main" | tee /etc/apt/sources.list.d/nodesource.list && \ |
Jano Svitok | 299b68e | 2020-03-09 23:07:30 +0100 | [diff] [blame] | 58 | |
| 59 | # ruby 2.4 |
| 60 | apt-add-repository ppa:brightbox/ruby-ng |
Brian Forbis | b5d6ea3 | 2018-08-25 23:39:29 -0400 | [diff] [blame] | 61 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 62 | ### install general dependencies |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 63 | 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] | 64 | `# General dependencies` \ |
James E. King, III | f454369 | 2017-09-01 05:23:29 -0700 | [diff] [blame] | 65 | bash-completion \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 66 | bison \ |
| 67 | build-essential \ |
| 68 | clang \ |
| 69 | cmake \ |
| 70 | debhelper \ |
| 71 | flex \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 72 | gdb \ |
| 73 | llvm \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 74 | ninja-build \ |
| 75 | pkg-config \ |
James E. King, III | 7d211b8 | 2017-09-06 10:12:02 -0700 | [diff] [blame] | 76 | valgrind \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 77 | vim |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 78 | ENV PATH /usr/lib/llvm-3.8/bin:$PATH |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 79 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 80 | ### languages |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 81 | |
| 82 | RUN apt-get install -y --no-install-recommends \ |
| 83 | `# C++ dependencies` \ |
| 84 | libboost-dev \ |
| 85 | libboost-filesystem-dev \ |
| 86 | libboost-program-options-dev \ |
| 87 | libboost-system-dev \ |
| 88 | libboost-test-dev \ |
| 89 | libboost-thread-dev \ |
| 90 | libevent-dev \ |
| 91 | libssl-dev \ |
| 92 | qt5-default \ |
| 93 | qtbase5-dev \ |
| 94 | qtbase5-dev-tools |
| 95 | |
James E. King III | b92ca5f | 2018-06-09 23:02:12 -0400 | [diff] [blame] | 96 | ENV D_VERSION 2.075.1-0 |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 97 | RUN apt-get install -y --allow-unauthenticated --no-install-recommends \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 98 | `# D dependencies` \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 99 | dmd-bin=$D_VERSION \ |
| 100 | libphobos2-dev=$D_VERSION \ |
James E. King III | b92ca5f | 2018-06-09 23:02:12 -0400 | [diff] [blame] | 101 | dub=1.6.0-0 \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 102 | dfmt \ |
| 103 | dscanner \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 104 | libevent-dev \ |
| 105 | libssl-dev \ |
| 106 | xdg-utils |
James E. King III | f338d57 | 2018-01-29 14:51:24 -0500 | [diff] [blame] | 107 | RUN mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \ |
| 108 | curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \ |
| 109 | mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \ |
| 110 | mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \ |
| 111 | rm -rf libevent-master |
James E. King III | 98acf18 | 2018-09-26 14:34:34 +0000 | [diff] [blame] | 112 | RUN curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/v1.1.6+1.0.1g.tar.gz | tar xz && \ |
| 113 | mv openssl-1.1.6-1.0.1g/deimos/* /usr/include/dmd/druntime/import/deimos/ && \ |
| 114 | mv openssl-1.1.6-1.0.1g/C/* /usr/include/dmd/druntime/import/C/ && \ |
| 115 | rm -rf openssl-1.1.6-1.0.1g |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 116 | |
aaronstgeorge-wf | 1ab156a | 2020-10-01 17:28:28 +0200 | [diff] [blame] | 117 | ENV DART_VERSION 2.7.2-1 |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 118 | RUN apt-get install -y --no-install-recommends \ |
| 119 | `# Dart dependencies` \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 120 | dart=$DART_VERSION |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 121 | ENV PATH /usr/lib/dart/bin:$PATH |
| 122 | |
James E. King, III | b628736 | 2017-09-28 11:57:42 +0000 | [diff] [blame] | 123 | RUN apt-get install -y --no-install-recommends \ |
| 124 | `# dotnet core dependencies` \ |
Jens Geyer | 526a1ac | 2021-02-13 13:58:09 +0100 | [diff] [blame] | 125 | dotnet-sdk-5.0 |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -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 | |
John Boiles | 5785279 | 2018-01-05 14:37:05 -0800 | [diff] [blame] | 139 | # golang |
Yuxuan 'fishy' Wang | b71f11e | 2021-03-22 15:01:00 -0700 | [diff] [blame^] | 140 | ENV GOLANG_VERSION 1.15.10 |
John Boiles | 5785279 | 2018-01-05 14:37:05 -0800 | [diff] [blame] | 141 | ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz |
Yuxuan 'fishy' Wang | b71f11e | 2021-03-22 15:01:00 -0700 | [diff] [blame^] | 142 | ENV GOLANG_DOWNLOAD_SHA256 4aa1267517df32f2bf1cc3d55dfc27d0c6b2c2b0989449c96dd19273ccca051d |
John Boiles | 5785279 | 2018-01-05 14:37:05 -0800 | [diff] [blame] | 143 | RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \ |
| 144 | echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \ |
| 145 | tar -C /usr/local -xzf golang.tar.gz && \ |
| 146 | ln -s /usr/local/go/bin/go /usr/local/bin && \ |
| 147 | rm golang.tar.gz |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 148 | |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 149 | RUN apt-get install -y --no-install-recommends \ |
| 150 | `# Haxe dependencies` \ |
| 151 | haxe \ |
| 152 | neko \ |
| 153 | neko-dev \ |
James E. King III | ad23852 | 2018-01-13 19:52:31 -0500 | [diff] [blame] | 154 | libneko0 && \ |
| 155 | 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 3.4.64 2>&1 > /dev/null |
James E. King, III | 81cdcd3 | 2017-09-09 17:54:10 +0000 | [diff] [blame] | 157 | # 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] | 158 | |
| 159 | RUN apt-get install -y --no-install-recommends \ |
| 160 | `# Java dependencies` \ |
| 161 | ant \ |
| 162 | ant-optional \ |
| 163 | openjdk-8-jdk \ |
| 164 | maven |
| 165 | |
James E. King III | 93ff9b0 | 2019-06-21 17:50:34 -0400 | [diff] [blame] | 166 | # disabled: same as ubuntu-bionic jobs |
| 167 | # RUN apt-get install -y --no-install-recommends \ |
| 168 | # `# Lua dependencies` \ |
| 169 | # lua5.2 \ |
| 170 | # lua5.2-dev |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 171 | # https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212 |
| 172 | # 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] | 173 | |
| 174 | RUN apt-get install -y --no-install-recommends \ |
| 175 | `# Node.js dependencies` \ |
James E. King III | a37feaf | 2018-03-06 15:11:01 -0500 | [diff] [blame] | 176 | nodejs |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 177 | |
Brian Forbis | b5d6ea3 | 2018-08-25 23:39:29 -0400 | [diff] [blame] | 178 | # Test dependencies for running puppeteer |
| 179 | RUN apt-get install -y --no-install-recommends \ |
| 180 | `# JS dependencies` \ |
| 181 | libxss1 \ |
| 182 | libatk-bridge2.0-0 \ |
| 183 | libgtk-3-0 |
| 184 | |
James E. King III | a02ae56 | 2018-03-12 15:27:23 -0400 | [diff] [blame] | 185 | # THRIFT-4517: causes stack overflows; version too old; skip ocaml in xenial |
| 186 | # RUN apt-get install -y --no-install-recommends \ |
| 187 | # `# OCaml dependencies` \ |
| 188 | # ocaml \ |
| 189 | # opam && \ |
| 190 | # opam init --yes && \ |
| 191 | # opam install --yes oasis |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 192 | |
| 193 | RUN apt-get install -y --no-install-recommends \ |
| 194 | `# Perl dependencies` \ |
| 195 | libbit-vector-perl \ |
| 196 | libclass-accessor-class-perl \ |
| 197 | libcrypt-ssleay-perl \ |
| 198 | libio-socket-ssl-perl \ |
Kengo Seki | cb4c31a | 2019-12-26 14:34:57 +0900 | [diff] [blame] | 199 | libnet-ssleay-perl \ |
| 200 | libtest-exception-perl |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 201 | |
| 202 | RUN apt-get install -y --no-install-recommends \ |
| 203 | `# Php dependencies` \ |
| 204 | php7.0 \ |
| 205 | php7.0-cli \ |
| 206 | php7.0-dev \ |
James E. King III | e53d23c | 2019-02-10 11:13:23 -0500 | [diff] [blame] | 207 | php-json \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 208 | php-pear \ |
| 209 | re2c \ |
Robert Lu | a15060a | 2017-12-28 15:29:39 +0800 | [diff] [blame] | 210 | composer |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 211 | |
| 212 | RUN apt-get install -y --no-install-recommends \ |
| 213 | `# Python dependencies` \ |
| 214 | python-all \ |
| 215 | python-all-dbg \ |
| 216 | python-all-dev \ |
| 217 | python-backports.ssl-match-hostname \ |
| 218 | python-ipaddress \ |
| 219 | python-pip \ |
| 220 | python-setuptools \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 221 | python-six \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 222 | python-tornado \ |
| 223 | python-twisted \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 224 | python-wheel \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 225 | python-zope.interface \ |
| 226 | python3-all \ |
| 227 | python3-all-dbg \ |
| 228 | python3-all-dev \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 229 | python3-setuptools \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 230 | python3-six \ |
| 231 | python3-tornado \ |
| 232 | python3-twisted \ |
| 233 | python3-wheel \ |
| 234 | python3-zope.interface && \ |
| 235 | pip install --upgrade backports.ssl_match_hostname |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 236 | |
| 237 | RUN apt-get install -y --no-install-recommends \ |
| 238 | `# Ruby dependencies` \ |
Jano Svitok | 299b68e | 2020-03-09 23:07:30 +0100 | [diff] [blame] | 239 | ruby2.4 \ |
| 240 | ruby2.4-dev \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 241 | ruby-bundler |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 242 | |
Danny Browning | 181d900 | 2019-04-15 09:50:24 -0600 | [diff] [blame] | 243 | # Rust dependencies |
Allen George | b0d1413 | 2020-03-29 11:48:55 -0400 | [diff] [blame] | 244 | RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.40.0 -y |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 245 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 246 | # Clean up |
| 247 | RUN rm -rf /var/cache/apt/* && \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 248 | rm -rf /var/lib/apt/lists/* && \ |
| 249 | rm -rf /tmp/* && \ |
| 250 | rm -rf /var/tmp/* |
| 251 | |
James E. King, III | b628736 | 2017-09-28 11:57:42 +0000 | [diff] [blame] | 252 | ENV DOTNET_CLI_TELEMETRY_OPTOUT 1 |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 253 | ENV THRIFT_ROOT /thrift |
| 254 | RUN mkdir -p $THRIFT_ROOT/src |
| 255 | COPY Dockerfile $THRIFT_ROOT/ |
| 256 | WORKDIR $THRIFT_ROOT/src |