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 Lacey | 7054b31 | 2021-03-26 11:38:38 -0700 | [diff] [blame] | 16 | # - d: does not come with Ubuntu so we're installing 2.087.0 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 | # Dart |
James E. King III | 93ff9b0 | 2019-06-21 17:50:34 -0400 | [diff] [blame] | 41 | 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] | 42 | 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] | 43 | /etc/apt/sources.list.d/dart_stable.list && \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 44 | |
James E. King, III | 6e883f9 | 2017-11-18 21:18:05 -0500 | [diff] [blame] | 45 | # dotnet (core) |
James E. King III | 93ff9b0 | 2019-06-21 17:50:34 -0400 | [diff] [blame] | 46 | 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] | 47 | 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] | 48 | /etc/apt/sources.list.d/dotnetdev.list && \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 49 | |
James E. King III | a37feaf | 2018-03-06 15:11:01 -0500 | [diff] [blame] | 50 | # node.js |
James E. King III | 93ff9b0 | 2019-06-21 17:50:34 -0400 | [diff] [blame] | 51 | 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] | 52 | 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] | 53 | |
| 54 | # ruby 2.4 |
| 55 | apt-add-repository ppa:brightbox/ruby-ng |
Brian Forbis | b5d6ea3 | 2018-08-25 23:39:29 -0400 | [diff] [blame] | 56 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 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 | |
James Lacey | 7054b31 | 2021-03-26 11:38:38 -0700 | [diff] [blame] | 91 | ENV D_VERSION 2.087.0 |
| 92 | ENV DMD_DEB dmd_2.087.0-0_amd64.deb |
| 93 | RUN \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 94 | `# D dependencies` \ |
James Lacey | 7054b31 | 2021-03-26 11:38:38 -0700 | [diff] [blame] | 95 | wget -q http://downloads.dlang.org/releases/2.x/${D_VERSION}/${DMD_DEB} && \ |
| 96 | dpkg --install ${DMD_DEB} && \ |
| 97 | rm -f ${DMD_DEB} && \ |
| 98 | mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \ |
| 99 | git clone -b 'v2.0.2+2.0.16' https://github.com/D-Programming-Deimos/libevent.git deimos-libevent-2.0 && \ |
| 100 | mv deimos-libevent-2.0/deimos/* /usr/include/dmd/druntime/import/deimos/ && \ |
| 101 | mv deimos-libevent-2.0/C/* /usr/include/dmd/druntime/import/C/ && \ |
| 102 | rm -rf deimos-libevent-2.0 && \ |
| 103 | git clone -b 'v1.1.6+1.0.1g' https://github.com/D-Programming-Deimos/openssl.git deimos-openssl-1.0.1g && \ |
| 104 | mv deimos-openssl-1.0.1g/deimos/* /usr/include/dmd/druntime/import/deimos/ && \ |
| 105 | mv deimos-openssl-1.0.1g/C/* /usr/include/dmd/druntime/import/C/ && \ |
| 106 | rm -rf deimos-openssl-1.0.1g |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 107 | |
aaronstgeorge-wf | 1ab156a | 2020-10-01 17:28:28 +0200 | [diff] [blame] | 108 | ENV DART_VERSION 2.7.2-1 |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 109 | RUN apt-get install -y --no-install-recommends \ |
| 110 | `# Dart dependencies` \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 111 | dart=$DART_VERSION |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 112 | ENV PATH /usr/lib/dart/bin:$PATH |
| 113 | |
James E. King, III | b628736 | 2017-09-28 11:57:42 +0000 | [diff] [blame] | 114 | RUN apt-get install -y --no-install-recommends \ |
| 115 | `# dotnet core dependencies` \ |
Jens Geyer | 526a1ac | 2021-02-13 13:58:09 +0100 | [diff] [blame] | 116 | dotnet-sdk-5.0 |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 117 | |
| 118 | RUN apt-get install -y --no-install-recommends \ |
| 119 | `# Erlang dependencies` \ |
| 120 | erlang-base \ |
| 121 | erlang-eunit \ |
| 122 | erlang-dev \ |
| 123 | erlang-tools \ |
| 124 | rebar |
| 125 | |
| 126 | RUN apt-get install -y --no-install-recommends \ |
| 127 | `# GlibC dependencies` \ |
| 128 | libglib2.0-dev |
| 129 | |
John Boiles | 5785279 | 2018-01-05 14:37:05 -0800 | [diff] [blame] | 130 | # golang |
Yuxuan 'fishy' Wang | b71f11e | 2021-03-22 15:01:00 -0700 | [diff] [blame] | 131 | ENV GOLANG_VERSION 1.15.10 |
John Boiles | 5785279 | 2018-01-05 14:37:05 -0800 | [diff] [blame] | 132 | 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] | 133 | ENV GOLANG_DOWNLOAD_SHA256 4aa1267517df32f2bf1cc3d55dfc27d0c6b2c2b0989449c96dd19273ccca051d |
John Boiles | 5785279 | 2018-01-05 14:37:05 -0800 | [diff] [blame] | 134 | RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \ |
| 135 | echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \ |
| 136 | tar -C /usr/local -xzf golang.tar.gz && \ |
| 137 | ln -s /usr/local/go/bin/go /usr/local/bin && \ |
| 138 | rm golang.tar.gz |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 139 | |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 140 | RUN apt-get install -y --no-install-recommends \ |
| 141 | `# Haxe dependencies` \ |
| 142 | haxe \ |
| 143 | neko \ |
| 144 | neko-dev \ |
James E. King III | ad23852 | 2018-01-13 19:52:31 -0500 | [diff] [blame] | 145 | libneko0 && \ |
| 146 | haxelib setup --always /usr/share/haxe/lib && \ |
James E. King III | f64a3fc | 2018-01-14 08:54:25 -0500 | [diff] [blame] | 147 | 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] | 148 | # 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] | 149 | |
| 150 | RUN apt-get install -y --no-install-recommends \ |
| 151 | `# Java dependencies` \ |
| 152 | ant \ |
| 153 | ant-optional \ |
| 154 | openjdk-8-jdk \ |
| 155 | maven |
| 156 | |
James E. King III | 93ff9b0 | 2019-06-21 17:50:34 -0400 | [diff] [blame] | 157 | # disabled: same as ubuntu-bionic jobs |
| 158 | # RUN apt-get install -y --no-install-recommends \ |
| 159 | # `# Lua dependencies` \ |
| 160 | # lua5.2 \ |
| 161 | # lua5.2-dev |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 162 | # https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212 |
| 163 | # 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] | 164 | |
| 165 | RUN apt-get install -y --no-install-recommends \ |
| 166 | `# Node.js dependencies` \ |
James E. King III | a37feaf | 2018-03-06 15:11:01 -0500 | [diff] [blame] | 167 | nodejs |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 168 | |
Brian Forbis | b5d6ea3 | 2018-08-25 23:39:29 -0400 | [diff] [blame] | 169 | # Test dependencies for running puppeteer |
| 170 | RUN apt-get install -y --no-install-recommends \ |
| 171 | `# JS dependencies` \ |
| 172 | libxss1 \ |
Yuxuan 'fishy' Wang | 0f73558 | 2021-04-28 08:33:36 -0700 | [diff] [blame^] | 173 | libxtst6 \ |
Brian Forbis | b5d6ea3 | 2018-08-25 23:39:29 -0400 | [diff] [blame] | 174 | libatk-bridge2.0-0 \ |
| 175 | libgtk-3-0 |
| 176 | |
James E. King III | a02ae56 | 2018-03-12 15:27:23 -0400 | [diff] [blame] | 177 | # THRIFT-4517: causes stack overflows; version too old; skip ocaml in xenial |
| 178 | # RUN apt-get install -y --no-install-recommends \ |
| 179 | # `# OCaml dependencies` \ |
| 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 \ |
Kengo Seki | cb4c31a | 2019-12-26 14:34:57 +0900 | [diff] [blame] | 191 | libnet-ssleay-perl \ |
| 192 | libtest-exception-perl |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 193 | |
| 194 | RUN apt-get install -y --no-install-recommends \ |
| 195 | `# Php dependencies` \ |
| 196 | php7.0 \ |
| 197 | php7.0-cli \ |
| 198 | php7.0-dev \ |
James E. King III | e53d23c | 2019-02-10 11:13:23 -0500 | [diff] [blame] | 199 | php-json \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 200 | php-pear \ |
| 201 | re2c \ |
Robert Lu | a15060a | 2017-12-28 15:29:39 +0800 | [diff] [blame] | 202 | composer |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 203 | |
| 204 | RUN apt-get install -y --no-install-recommends \ |
| 205 | `# Python dependencies` \ |
| 206 | python-all \ |
| 207 | python-all-dbg \ |
| 208 | python-all-dev \ |
| 209 | python-backports.ssl-match-hostname \ |
| 210 | python-ipaddress \ |
| 211 | python-pip \ |
| 212 | python-setuptools \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 213 | python-six \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 214 | python-tornado \ |
| 215 | python-twisted \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 216 | python-wheel \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 217 | python-zope.interface \ |
| 218 | python3-all \ |
| 219 | python3-all-dbg \ |
| 220 | python3-all-dev \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 221 | python3-setuptools \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 222 | python3-six \ |
| 223 | python3-tornado \ |
| 224 | python3-twisted \ |
| 225 | python3-wheel \ |
| 226 | python3-zope.interface && \ |
| 227 | pip install --upgrade backports.ssl_match_hostname |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 228 | |
| 229 | RUN apt-get install -y --no-install-recommends \ |
| 230 | `# Ruby dependencies` \ |
Jano Svitok | 299b68e | 2020-03-09 23:07:30 +0100 | [diff] [blame] | 231 | ruby2.4 \ |
| 232 | ruby2.4-dev \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 233 | ruby-bundler |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 234 | |
Danny Browning | 181d900 | 2019-04-15 09:50:24 -0600 | [diff] [blame] | 235 | # Rust dependencies |
Allen George | b0d1413 | 2020-03-29 11:48:55 -0400 | [diff] [blame] | 236 | 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] | 237 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 238 | # Clean up |
| 239 | RUN rm -rf /var/cache/apt/* && \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 240 | rm -rf /var/lib/apt/lists/* && \ |
| 241 | rm -rf /tmp/* && \ |
| 242 | rm -rf /var/tmp/* |
| 243 | |
James E. King, III | b628736 | 2017-09-28 11:57:42 +0000 | [diff] [blame] | 244 | ENV DOTNET_CLI_TELEMETRY_OPTOUT 1 |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 245 | ENV THRIFT_ROOT /thrift |
| 246 | RUN mkdir -p $THRIFT_ROOT/src |
| 247 | COPY Dockerfile $THRIFT_ROOT/ |
| 248 | WORKDIR $THRIFT_ROOT/src |