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 |
Rob Becker | f1eadad | 2019-01-21 20:24:01 -0700 | [diff] [blame] | 17 | # - dart: does not come with Ubuntu so we're installing 1.24.3 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 |
John Boiles | 5785279 | 2018-01-05 14:37:05 -0800 | [diff] [blame] | 20 | # - nodejs: Xenial comes with 4.2.6 which exits LTS April 2018, so we're installing 6.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 \ |
Robert Lu | 31d5b7b | 2018-01-05 13:44:38 +0800 | [diff] [blame] | 38 | wget |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 39 | |
James E. King, III | f454369 | 2017-09-01 05:23:29 -0700 | [diff] [blame] | 40 | # csharp (mono) |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 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 |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 43 | |
| 44 | # D |
James E. King III | ad23852 | 2018-01-13 19:52:31 -0500 | [diff] [blame] | 45 | RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EBCF975E5BA24D5E && \ |
| 46 | 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] | 47 | 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] | 48 | |
| 49 | # Dart |
| 50 | RUN 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] | 51 | curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > \ |
| 52 | /etc/apt/sources.list.d/dart_stable.list |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 53 | |
James E. King, III | 6e883f9 | 2017-11-18 21:18:05 -0500 | [diff] [blame] | 54 | # dotnet (core) |
James E. King, III | b628736 | 2017-09-28 11:57:42 +0000 | [diff] [blame] | 55 | 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] | 56 | echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > \ |
| 57 | /etc/apt/sources.list.d/dotnetdev.list |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 58 | |
James E. King III | a37feaf | 2018-03-06 15:11:01 -0500 | [diff] [blame] | 59 | # node.js |
| 60 | RUN curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \ |
| 61 | echo "deb https://deb.nodesource.com/node_6.x xenial main" | tee /etc/apt/sources.list.d/nodesource.list |
Brian Forbis | b5d6ea3 | 2018-08-25 23:39:29 -0400 | [diff] [blame] | 62 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 63 | ### install general dependencies |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 64 | 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] | 65 | `# General dependencies` \ |
James E. King, III | f454369 | 2017-09-01 05:23:29 -0700 | [diff] [blame] | 66 | bash-completion \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 67 | bison \ |
| 68 | build-essential \ |
| 69 | clang \ |
| 70 | cmake \ |
| 71 | debhelper \ |
| 72 | flex \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 73 | gdb \ |
| 74 | llvm \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 75 | ninja-build \ |
| 76 | pkg-config \ |
James E. King, III | 7d211b8 | 2017-09-06 10:12:02 -0700 | [diff] [blame] | 77 | valgrind \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 78 | vim |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 79 | ENV PATH /usr/lib/llvm-3.8/bin:$PATH |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 80 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 81 | ### languages |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 82 | |
| 83 | RUN apt-get install -y --no-install-recommends \ |
| 84 | `# C++ dependencies` \ |
| 85 | libboost-dev \ |
| 86 | libboost-filesystem-dev \ |
| 87 | libboost-program-options-dev \ |
| 88 | libboost-system-dev \ |
| 89 | libboost-test-dev \ |
| 90 | libboost-thread-dev \ |
| 91 | libevent-dev \ |
| 92 | libssl-dev \ |
| 93 | qt5-default \ |
| 94 | qtbase5-dev \ |
| 95 | qtbase5-dev-tools |
| 96 | |
| 97 | RUN apt-get install -y --no-install-recommends \ |
James E. King, III | f454369 | 2017-09-01 05:23:29 -0700 | [diff] [blame] | 98 | `# csharp (mono) dependencies` \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 99 | mono-devel |
| 100 | |
James E. King III | b92ca5f | 2018-06-09 23:02:12 -0400 | [diff] [blame] | 101 | ENV D_VERSION 2.075.1-0 |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 102 | RUN apt-get install -y --allow-unauthenticated --no-install-recommends \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 103 | `# D dependencies` \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 104 | dmd-bin=$D_VERSION \ |
| 105 | libphobos2-dev=$D_VERSION \ |
James E. King III | b92ca5f | 2018-06-09 23:02:12 -0400 | [diff] [blame] | 106 | dub=1.6.0-0 \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 107 | dfmt \ |
| 108 | dscanner \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 109 | libevent-dev \ |
| 110 | libssl-dev \ |
| 111 | xdg-utils |
James E. King III | f338d57 | 2018-01-29 14:51:24 -0500 | [diff] [blame] | 112 | RUN mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \ |
| 113 | curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \ |
| 114 | mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \ |
| 115 | mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \ |
| 116 | rm -rf libevent-master |
James E. King III | 98acf18 | 2018-09-26 14:34:34 +0000 | [diff] [blame] | 117 | RUN curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/v1.1.6+1.0.1g.tar.gz | tar xz && \ |
| 118 | mv openssl-1.1.6-1.0.1g/deimos/* /usr/include/dmd/druntime/import/deimos/ && \ |
| 119 | mv openssl-1.1.6-1.0.1g/C/* /usr/include/dmd/druntime/import/C/ && \ |
| 120 | rm -rf openssl-1.1.6-1.0.1g |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 121 | |
Rob Becker | f1eadad | 2019-01-21 20:24:01 -0700 | [diff] [blame] | 122 | ENV DART_VERSION 1.24.3-1 |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 123 | RUN apt-get install -y --no-install-recommends \ |
| 124 | `# Dart dependencies` \ |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 125 | dart=$DART_VERSION |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 126 | ENV PATH /usr/lib/dart/bin:$PATH |
| 127 | |
James E. King, III | b628736 | 2017-09-28 11:57:42 +0000 | [diff] [blame] | 128 | RUN apt-get install -y --no-install-recommends \ |
| 129 | `# dotnet core dependencies` \ |
Rob Becker | f1eadad | 2019-01-21 20:24:01 -0700 | [diff] [blame] | 130 | dotnet-sdk-2.1 |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 131 | |
| 132 | RUN apt-get install -y --no-install-recommends \ |
| 133 | `# Erlang dependencies` \ |
| 134 | erlang-base \ |
| 135 | erlang-eunit \ |
| 136 | erlang-dev \ |
| 137 | erlang-tools \ |
| 138 | rebar |
| 139 | |
| 140 | RUN apt-get install -y --no-install-recommends \ |
| 141 | `# GlibC dependencies` \ |
| 142 | libglib2.0-dev |
| 143 | |
John Boiles | 5785279 | 2018-01-05 14:37:05 -0800 | [diff] [blame] | 144 | # golang |
James E. King III | 3b77982 | 2019-03-15 15:59:27 -0400 | [diff] [blame] | 145 | ENV GOLANG_VERSION 1.10.8 |
John Boiles | 5785279 | 2018-01-05 14:37:05 -0800 | [diff] [blame] | 146 | ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz |
James E. King III | 3b77982 | 2019-03-15 15:59:27 -0400 | [diff] [blame] | 147 | ENV GOLANG_DOWNLOAD_SHA256 d8626fb6f9a3ab397d88c483b576be41fa81eefcec2fd18562c87626dbb3c39e |
John Boiles | 5785279 | 2018-01-05 14:37:05 -0800 | [diff] [blame] | 148 | RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \ |
| 149 | echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \ |
| 150 | tar -C /usr/local -xzf golang.tar.gz && \ |
| 151 | ln -s /usr/local/go/bin/go /usr/local/bin && \ |
| 152 | rm golang.tar.gz |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 153 | |
James E. King III | f74bc7b | 2018-09-14 17:56:49 +0000 | [diff] [blame] | 154 | # due to a bug in cabal in xenial (cabal-install package) we pull in another: |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 155 | RUN apt-get install -y --no-install-recommends \ |
| 156 | `# Haskell dependencies` \ |
James E. King III | f74bc7b | 2018-09-14 17:56:49 +0000 | [diff] [blame] | 157 | ghc && \ |
| 158 | cd /tmp && \ |
| 159 | wget -q https://www.haskell.org/cabal/release/cabal-install-1.24.0.2/cabal-install-1.24.0.2-x86_64-unknown-linux.tar.gz && \ |
| 160 | tar xzf cabal-install-1.24.0.2-x86_64-unknown-linux.tar.gz && \ |
| 161 | find dist-newstyle/ -type f -name cabal -exec mv {} /usr/bin \; && \ |
| 162 | rm -rf /tmp/cabal* && \ |
| 163 | cabal --version |
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 | `# Haxe dependencies` \ |
| 167 | haxe \ |
| 168 | neko \ |
| 169 | neko-dev \ |
James E. King III | ad23852 | 2018-01-13 19:52:31 -0500 | [diff] [blame] | 170 | libneko0 && \ |
| 171 | haxelib setup --always /usr/share/haxe/lib && \ |
James E. King III | f64a3fc | 2018-01-14 08:54:25 -0500 | [diff] [blame] | 172 | 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] | 173 | # 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] | 174 | |
| 175 | RUN apt-get install -y --no-install-recommends \ |
| 176 | `# Java dependencies` \ |
| 177 | ant \ |
| 178 | ant-optional \ |
| 179 | openjdk-8-jdk \ |
| 180 | maven |
| 181 | |
| 182 | RUN apt-get install -y --no-install-recommends \ |
| 183 | `# Lua dependencies` \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 184 | lua5.2 \ |
| 185 | lua5.2-dev |
| 186 | # https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212 |
| 187 | # 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] | 188 | |
| 189 | RUN apt-get install -y --no-install-recommends \ |
| 190 | `# Node.js dependencies` \ |
James E. King III | a37feaf | 2018-03-06 15:11:01 -0500 | [diff] [blame] | 191 | nodejs |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 192 | |
Brian Forbis | b5d6ea3 | 2018-08-25 23:39:29 -0400 | [diff] [blame] | 193 | # Test dependencies for running puppeteer |
| 194 | RUN apt-get install -y --no-install-recommends \ |
| 195 | `# JS dependencies` \ |
| 196 | libxss1 \ |
| 197 | libatk-bridge2.0-0 \ |
| 198 | libgtk-3-0 |
| 199 | |
James E. King III | a02ae56 | 2018-03-12 15:27:23 -0400 | [diff] [blame] | 200 | # THRIFT-4517: causes stack overflows; version too old; skip ocaml in xenial |
| 201 | # RUN apt-get install -y --no-install-recommends \ |
| 202 | # `# OCaml dependencies` \ |
| 203 | # ocaml \ |
| 204 | # opam && \ |
| 205 | # opam init --yes && \ |
| 206 | # opam install --yes oasis |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 207 | |
| 208 | RUN apt-get install -y --no-install-recommends \ |
| 209 | `# Perl dependencies` \ |
| 210 | libbit-vector-perl \ |
| 211 | libclass-accessor-class-perl \ |
| 212 | libcrypt-ssleay-perl \ |
| 213 | libio-socket-ssl-perl \ |
| 214 | libnet-ssleay-perl |
| 215 | |
| 216 | RUN apt-get install -y --no-install-recommends \ |
| 217 | `# Php dependencies` \ |
| 218 | php7.0 \ |
| 219 | php7.0-cli \ |
| 220 | php7.0-dev \ |
James E. King III | e53d23c | 2019-02-10 11:13:23 -0500 | [diff] [blame] | 221 | php-json \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 222 | php-pear \ |
| 223 | re2c \ |
Robert Lu | a15060a | 2017-12-28 15:29:39 +0800 | [diff] [blame] | 224 | composer |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 225 | |
| 226 | RUN apt-get install -y --no-install-recommends \ |
| 227 | `# Python dependencies` \ |
| 228 | python-all \ |
| 229 | python-all-dbg \ |
| 230 | python-all-dev \ |
| 231 | python-backports.ssl-match-hostname \ |
| 232 | python-ipaddress \ |
| 233 | python-pip \ |
| 234 | python-setuptools \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 235 | python-six \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 236 | python-tornado \ |
| 237 | python-twisted \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 238 | python-wheel \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 239 | python-zope.interface \ |
| 240 | python3-all \ |
| 241 | python3-all-dbg \ |
| 242 | python3-all-dev \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 243 | python3-setuptools \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 244 | python3-six \ |
| 245 | python3-tornado \ |
| 246 | python3-twisted \ |
| 247 | python3-wheel \ |
| 248 | python3-zope.interface && \ |
| 249 | pip install --upgrade backports.ssl_match_hostname |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 250 | |
| 251 | RUN apt-get install -y --no-install-recommends \ |
| 252 | `# Ruby dependencies` \ |
| 253 | ruby \ |
| 254 | ruby-dev \ |
| 255 | ruby-bundler |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 256 | |
Danny Browning | 181d900 | 2019-04-15 09:50:24 -0600 | [diff] [blame] | 257 | # Rust dependencies |
Allen George | c2c1e1d | 2019-07-01 07:46:04 -0400 | [diff] [blame] | 258 | RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.35.0 -y |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 259 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 260 | # Clean up |
| 261 | RUN rm -rf /var/cache/apt/* && \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 262 | rm -rf /var/lib/apt/lists/* && \ |
| 263 | rm -rf /tmp/* && \ |
| 264 | rm -rf /var/tmp/* |
| 265 | |
James E. King, III | b628736 | 2017-09-28 11:57:42 +0000 | [diff] [blame] | 266 | ENV DOTNET_CLI_TELEMETRY_OPTOUT 1 |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 267 | ENV THRIFT_ROOT /thrift |
| 268 | RUN mkdir -p $THRIFT_ROOT/src |
| 269 | COPY Dockerfile $THRIFT_ROOT/ |
| 270 | WORKDIR $THRIFT_ROOT/src |