James E. King III | f5f430d | 2018-06-08 03:37:55 +0000 | [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 Bionic |
| 15 | # Using all stock Ubuntu Bionic packaging except for: |
James E. King III | dabb539 | 2018-07-07 02:48:43 +0000 | [diff] [blame] | 16 | # - cl: want latest |
James E. King III | f5f430d | 2018-06-08 03:37:55 +0000 | [diff] [blame] | 17 | # - d: dmd does not come with Ubuntu |
Rob Becker | f1eadad | 2019-01-21 20:24:01 -0700 | [diff] [blame] | 18 | # - dart: does not come with Ubuntu - we use 2.x here |
James E. King III | f5f430d | 2018-06-08 03:37:55 +0000 | [diff] [blame] | 19 | # - dotnet: does not come with Ubuntu |
| 20 | # - go: want latest |
| 21 | # - nodejs: want v8, bionic comes with v6 |
James E. King III | f5f430d | 2018-06-08 03:37:55 +0000 | [diff] [blame] | 22 | # |
| 23 | |
| 24 | FROM buildpack-deps:bionic-scm |
| 25 | MAINTAINER Apache Thrift <dev@thrift.apache.org> |
| 26 | ENV DEBIAN_FRONTEND noninteractive |
| 27 | |
| 28 | ### Add apt repos |
| 29 | |
| 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 \ |
| 37 | dirmngr \ |
| 38 | software-properties-common \ |
| 39 | wget |
| 40 | |
| 41 | # csharp (mono) - if we ever want a later version |
| 42 | # RUN echo "deb http://download.mono-project.com/repo/debian xenial main" | tee /etc/apt/sources.list.d/mono.list && \ |
| 43 | # apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A6A19B38D3D831EF |
| 44 | |
| 45 | # Dart |
| 46 | RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ |
| 47 | curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > \ |
| 48 | /etc/apt/sources.list.d/dart_stable.list |
| 49 | |
| 50 | # dotnet (netcore) |
| 51 | RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \ |
| 52 | wget -q -O /etc/apt/sources.list.d/microsoft-prod.list https://packages.microsoft.com/config/ubuntu/18.04/prod.list && \ |
| 53 | chown root:root /etc/apt/trusted.gpg.d/microsoft.gpg && \ |
| 54 | chown root:root /etc/apt/sources.list.d/microsoft-prod.list |
| 55 | |
| 56 | # node.js |
| 57 | RUN curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \ |
| 58 | echo "deb https://deb.nodesource.com/node_8.x bionic main" | tee /etc/apt/sources.list.d/nodesource.list |
| 59 | |
| 60 | ### install general dependencies |
| 61 | RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 62 | `# General dependencies` \ |
| 63 | bash-completion \ |
| 64 | bison \ |
| 65 | build-essential \ |
| 66 | clang \ |
| 67 | cmake \ |
| 68 | debhelper \ |
| 69 | flex \ |
| 70 | gdb \ |
Fokko Driesprong | 1686c87 | 2019-02-01 20:31:58 +0100 | [diff] [blame] | 71 | libasound2 \ |
| 72 | libatk-bridge2.0-0 \ |
| 73 | libgtk-3-0 \ |
James E. King III | f5f430d | 2018-06-08 03:37:55 +0000 | [diff] [blame] | 74 | llvm \ |
| 75 | ninja-build \ |
| 76 | pkg-config \ |
James E. King III | b1d63e7 | 2019-01-22 14:16:39 -0500 | [diff] [blame] | 77 | unzip \ |
James E. King III | f5f430d | 2018-06-08 03:37:55 +0000 | [diff] [blame] | 78 | valgrind \ |
| 79 | vim |
| 80 | ENV PATH /usr/lib/llvm-6.0/bin:$PATH |
| 81 | |
James E. King III | b1d63e7 | 2019-01-22 14:16:39 -0500 | [diff] [blame] | 82 | # lib/as3 (ActionScript) |
| 83 | RUN mkdir -p /usr/local/adobe/flex/4.6 && \ |
| 84 | cd /usr/local/adobe/flex/4.6 && \ |
| 85 | wget -q "http://download.macromedia.com/pub/flex/sdk/flex_sdk_4.6.zip" && \ |
| 86 | unzip flex_sdk_4.6.zip |
| 87 | ENV FLEX_HOME /usr/local/adobe/flex/4.6 |
| 88 | |
James E. King III | f5f430d | 2018-06-08 03:37:55 +0000 | [diff] [blame] | 89 | RUN apt-get install -y --no-install-recommends \ |
| 90 | `# C++ dependencies` \ |
| 91 | libboost-all-dev \ |
| 92 | libevent-dev \ |
| 93 | libssl-dev \ |
| 94 | qt5-default \ |
| 95 | qtbase5-dev \ |
| 96 | qtbase5-dev-tools |
| 97 | |
| 98 | RUN apt-get install -y --no-install-recommends \ |
| 99 | `# csharp (mono) dependencies` \ |
| 100 | mono-devel |
| 101 | |
James E. King III | abf3aa5 | 2019-01-04 17:21:02 -0500 | [diff] [blame] | 102 | ENV SBCL_VERSION 1.4.15 |
James E. King III | f5f430d | 2018-06-08 03:37:55 +0000 | [diff] [blame] | 103 | RUN \ |
| 104 | `# Common Lisp (sbcl) dependencies` \ |
| 105 | curl --version && \ |
James E. King III | abf3aa5 | 2019-01-04 17:21:02 -0500 | [diff] [blame] | 106 | curl -o sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2 -J -L https://sourceforge.net/projects/sbcl/files/sbcl/${SBCL_VERSION}/sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2/download?use_mirror=managedway# && \ |
James E. King III | f5f430d | 2018-06-08 03:37:55 +0000 | [diff] [blame] | 107 | tar xjf sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2 && \ |
| 108 | cd sbcl-${SBCL_VERSION}-x86-64-linux && \ |
| 109 | ./install.sh && \ |
| 110 | sbcl --version && \ |
| 111 | cd .. && \ |
| 112 | rm -rf sbcl* |
| 113 | |
James E. King III | abf3aa5 | 2019-01-04 17:21:02 -0500 | [diff] [blame] | 114 | ENV D_VERSION 2.083.1 |
| 115 | ENV DMD_DEB dmd_2.083.1-0_amd64.deb |
James E. King III | f5f430d | 2018-06-08 03:37:55 +0000 | [diff] [blame] | 116 | RUN \ |
| 117 | `# D dependencies` \ |
| 118 | wget -q http://downloads.dlang.org/releases/2.x/${D_VERSION}/${DMD_DEB} && \ |
| 119 | dpkg --install ${DMD_DEB} && \ |
| 120 | rm -f ${DMD_DEB} && \ |
| 121 | mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \ |
James E. King III | abf3aa5 | 2019-01-04 17:21:02 -0500 | [diff] [blame] | 122 | git clone -b 'v2.0.2+2.0.16' https://github.com/D-Programming-Deimos/libevent.git deimos-libevent-2.0 && \ |
| 123 | mv deimos-libevent-2.0/deimos/* /usr/include/dmd/druntime/import/deimos/ && \ |
| 124 | mv deimos-libevent-2.0/C/* /usr/include/dmd/druntime/import/C/ && \ |
| 125 | rm -rf deimos-libevent-2.0 && \ |
James E. King III | 75bac10 | 2018-12-30 16:20:12 -0500 | [diff] [blame] | 126 | git clone -b 'v2.0.0+1.1.0h' https://github.com/D-Programming-Deimos/openssl.git deimos-openssl-1.1.0h && \ |
| 127 | mv deimos-openssl-1.1.0h/deimos/* /usr/include/dmd/druntime/import/deimos/ && \ |
| 128 | mv deimos-openssl-1.1.0h/C/* /usr/include/dmd/druntime/import/C/ && \ |
| 129 | rm -rf deimos-openssl-1.1.0h |
James E. King III | f5f430d | 2018-06-08 03:37:55 +0000 | [diff] [blame] | 130 | |
Rob Becker | f1eadad | 2019-01-21 20:24:01 -0700 | [diff] [blame] | 131 | ENV DART_VERSION 2.1.0-1 |
James E. King III | f5f430d | 2018-06-08 03:37:55 +0000 | [diff] [blame] | 132 | RUN apt-get install -y --no-install-recommends \ |
| 133 | `# Dart dependencies` \ |
Brian Forbis | c64389a | 2018-09-22 07:36:24 -0400 | [diff] [blame] | 134 | dart=$DART_VERSION |
James E. King III | f5f430d | 2018-06-08 03:37:55 +0000 | [diff] [blame] | 135 | ENV PATH /usr/lib/dart/bin:$PATH |
| 136 | |
| 137 | RUN apt-get install -y --no-install-recommends \ |
| 138 | `# dotnet core dependencies` \ |
James E. King III | abf3aa5 | 2019-01-04 17:21:02 -0500 | [diff] [blame] | 139 | dotnet-sdk-2.2 |
James E. King III | f5f430d | 2018-06-08 03:37:55 +0000 | [diff] [blame] | 140 | |
| 141 | RUN apt-get install -y --no-install-recommends \ |
| 142 | `# Erlang dependencies` \ |
| 143 | erlang-base \ |
| 144 | erlang-eunit \ |
| 145 | erlang-dev \ |
| 146 | erlang-tools \ |
| 147 | rebar |
| 148 | |
| 149 | RUN apt-get install -y --no-install-recommends \ |
| 150 | `# GlibC dependencies` \ |
| 151 | libglib2.0-dev |
| 152 | |
| 153 | # golang |
James E. King III | 3b77982 | 2019-03-15 15:59:27 -0400 | [diff] [blame] | 154 | ENV GOLANG_VERSION 1.12.1 |
James E. King III | f5f430d | 2018-06-08 03:37:55 +0000 | [diff] [blame] | 155 | 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] | 156 | ENV GOLANG_DOWNLOAD_SHA256 2a3fdabf665496a0db5f41ec6af7a9b15a49fbe71a85a50ca38b1f13a103aeec |
James E. King III | f5f430d | 2018-06-08 03:37:55 +0000 | [diff] [blame] | 157 | RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \ |
| 158 | echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \ |
| 159 | tar -C /usr/local -xzf golang.tar.gz && \ |
| 160 | ln -s /usr/local/go/bin/go /usr/local/bin && \ |
| 161 | rm golang.tar.gz |
| 162 | |
| 163 | RUN apt-get install -y --no-install-recommends \ |
| 164 | `# Haskell dependencies` \ |
| 165 | ghc \ |
| 166 | cabal-install |
| 167 | |
| 168 | RUN apt-get install -y --no-install-recommends \ |
| 169 | `# Haxe dependencies` \ |
| 170 | haxe \ |
| 171 | neko \ |
| 172 | neko-dev && \ |
| 173 | haxelib setup --always /usr/share/haxe/lib && \ |
| 174 | haxelib install --always hxcpp 2>&1 > /dev/null |
| 175 | |
| 176 | RUN apt-get install -y --no-install-recommends \ |
| 177 | `# Java dependencies` \ |
| 178 | ant \ |
| 179 | ant-optional \ |
Fokko Driesprong | 1686c87 | 2019-02-01 20:31:58 +0100 | [diff] [blame] | 180 | maven \ |
| 181 | openjdk-11-jdk-headless |
James E. King III | f5f430d | 2018-06-08 03:37:55 +0000 | [diff] [blame] | 182 | |
| 183 | RUN apt-get install -y --no-install-recommends \ |
| 184 | `# Lua dependencies` \ |
| 185 | lua5.2 \ |
| 186 | lua5.2-dev |
| 187 | # https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212 |
| 188 | # lua5.3 does not install alternatives! |
| 189 | # need to update our luasocket code, lua doesn't have luaL_openlib any more |
| 190 | |
| 191 | RUN apt-get install -y --no-install-recommends \ |
| 192 | `# Node.js dependencies` \ |
| 193 | nodejs |
| 194 | |
Brian Forbis | b5d6ea3 | 2018-08-25 23:39:29 -0400 | [diff] [blame] | 195 | # Test dependencies for running puppeteer |
| 196 | RUN apt-get install -y --no-install-recommends \ |
| 197 | `# JS dependencies` \ |
| 198 | libxss1 |
| 199 | |
James E. King III | f5f430d | 2018-06-08 03:37:55 +0000 | [diff] [blame] | 200 | RUN apt-get install -y --no-install-recommends \ |
| 201 | `# OCaml dependencies` \ |
| 202 | ocaml \ |
| 203 | opam && \ |
| 204 | opam init --yes && \ |
| 205 | opam install --yes oasis |
| 206 | |
| 207 | RUN apt-get install -y --no-install-recommends \ |
| 208 | `# Perl dependencies` \ |
| 209 | libbit-vector-perl \ |
| 210 | libclass-accessor-class-perl \ |
| 211 | libcrypt-ssleay-perl \ |
| 212 | libio-socket-ssl-perl \ |
| 213 | libnet-ssleay-perl |
| 214 | |
| 215 | RUN apt-get install -y --no-install-recommends \ |
| 216 | `# Php dependencies` \ |
| 217 | php \ |
| 218 | php-cli \ |
| 219 | php-dev \ |
James E. King III | e53d23c | 2019-02-10 11:13:23 -0500 | [diff] [blame] | 220 | php-json \ |
James E. King III | f5f430d | 2018-06-08 03:37:55 +0000 | [diff] [blame] | 221 | php-pear \ |
| 222 | re2c \ |
| 223 | composer |
| 224 | |
| 225 | RUN apt-get install -y --no-install-recommends \ |
| 226 | `# Python dependencies` \ |
| 227 | python-all \ |
| 228 | python-all-dbg \ |
| 229 | python-all-dev \ |
| 230 | python-ipaddress \ |
| 231 | python-pip \ |
| 232 | python-setuptools \ |
| 233 | python-six \ |
| 234 | python-tornado \ |
| 235 | python-twisted \ |
| 236 | python-wheel \ |
| 237 | python-zope.interface && \ |
| 238 | pip install --upgrade backports.ssl_match_hostname |
| 239 | |
| 240 | RUN apt-get install -y --no-install-recommends \ |
| 241 | `# Python3 dependencies` \ |
| 242 | python3-all \ |
| 243 | python3-all-dbg \ |
| 244 | python3-all-dev \ |
| 245 | python3-pip \ |
| 246 | python3-setuptools \ |
| 247 | python3-six \ |
| 248 | python3-tornado \ |
| 249 | python3-twisted \ |
| 250 | python3-wheel \ |
| 251 | python3-zope.interface |
| 252 | |
| 253 | RUN apt-get install -y --no-install-recommends \ |
| 254 | `# Ruby dependencies` \ |
| 255 | ruby \ |
| 256 | ruby-dev \ |
| 257 | ruby-bundler |
| 258 | |
Danny Browning | 181d900 | 2019-04-15 09:50:24 -0600 | [diff] [blame] | 259 | # Rust dependencies |
Allen George | c2c1e1d | 2019-07-01 07:46:04 -0400 | [diff] [blame^] | 260 | RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.35.0 -y |
James E. King III | f5f430d | 2018-06-08 03:37:55 +0000 | [diff] [blame] | 261 | |
James E. King III | a3a7c6c | 2018-12-31 17:17:34 -0500 | [diff] [blame] | 262 | # Swift on Linux for cross tests |
| 263 | RUN cd / && \ |
| 264 | wget --quiet https://swift.org/builds/swift-4.2.1-release/ubuntu1804/swift-4.2.1-RELEASE/swift-4.2.1-RELEASE-ubuntu18.04.tar.gz && \ |
| 265 | tar xf swift-4.2.1-RELEASE-ubuntu18.04.tar.gz --strip-components=1 && \ |
| 266 | rm swift-4.2.1-RELEASE-ubuntu18.04.tar.gz && \ |
| 267 | swift --version |
| 268 | |
James E. King III | f5f430d | 2018-06-08 03:37:55 +0000 | [diff] [blame] | 269 | # cppcheck-1.82 has a nasty cpp parser bug, so we're using something newer |
| 270 | RUN apt-get install -y --no-install-recommends \ |
| 271 | `# Static Code Analysis dependencies` \ |
| 272 | cppcheck \ |
| 273 | sloccount && \ |
| 274 | pip install flake8 && \ |
| 275 | wget -q "https://launchpad.net/ubuntu/+source/cppcheck/1.83-2/+build/14874703/+files/cppcheck_1.83-2_amd64.deb" && \ |
| 276 | dpkg -i cppcheck_1.83-2_amd64.deb && \ |
| 277 | rm cppcheck_1.83-2_amd64.deb |
| 278 | |
| 279 | # Clean up |
| 280 | RUN rm -rf /var/cache/apt/* && \ |
| 281 | rm -rf /var/lib/apt/lists/* && \ |
| 282 | rm -rf /tmp/* && \ |
| 283 | rm -rf /var/tmp/* |
| 284 | |
| 285 | ENV THRIFT_ROOT /thrift |
| 286 | RUN mkdir -p $THRIFT_ROOT/src |
| 287 | COPY Dockerfile $THRIFT_ROOT/ |
| 288 | WORKDIR $THRIFT_ROOT/src |