blob: a75af31c3e93246ad9c9cc1a82f6c62869c33cc9 [file] [log] [blame]
James E. King IIIf5f430d2018-06-08 03:37:55 +00001# 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 IIIdabb5392018-07-07 02:48:43 +000016# - cl: want latest
James E. King IIIf5f430d2018-06-08 03:37:55 +000017# - d: dmd does not come with Ubuntu
Rob Beckerf1eadad2019-01-21 20:24:01 -070018# - dart: does not come with Ubuntu - we use 2.x here
James E. King IIIf5f430d2018-06-08 03:37:55 +000019# - dotnet: does not come with Ubuntu
20# - go: want latest
21# - nodejs: want v8, bionic comes with v6
James E. King IIIf5f430d2018-06-08 03:37:55 +000022#
23
24FROM buildpack-deps:bionic-scm
25MAINTAINER Apache Thrift <dev@thrift.apache.org>
26ENV DEBIAN_FRONTEND noninteractive
27
28### Add apt repos
29
30RUN 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
46RUN 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)
51RUN 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
57RUN 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
61RUN 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 \
71 llvm \
72 ninja-build \
73 pkg-config \
James E. King IIIb1d63e72019-01-22 14:16:39 -050074 unzip \
James E. King IIIf5f430d2018-06-08 03:37:55 +000075 valgrind \
76 vim
77ENV PATH /usr/lib/llvm-6.0/bin:$PATH
78
James E. King IIIb1d63e72019-01-22 14:16:39 -050079# lib/as3 (ActionScript)
80RUN mkdir -p /usr/local/adobe/flex/4.6 && \
81 cd /usr/local/adobe/flex/4.6 && \
82 wget -q "http://download.macromedia.com/pub/flex/sdk/flex_sdk_4.6.zip" && \
83 unzip flex_sdk_4.6.zip
84ENV FLEX_HOME /usr/local/adobe/flex/4.6
85
James E. King IIIf5f430d2018-06-08 03:37:55 +000086RUN apt-get install -y --no-install-recommends \
87`# C++ dependencies` \
88 libboost-all-dev \
89 libevent-dev \
90 libssl-dev \
91 qt5-default \
92 qtbase5-dev \
93 qtbase5-dev-tools
94
95RUN apt-get install -y --no-install-recommends \
96`# csharp (mono) dependencies` \
97 mono-devel
98
James E. King IIIabf3aa52019-01-04 17:21:02 -050099ENV SBCL_VERSION 1.4.15
James E. King IIIf5f430d2018-06-08 03:37:55 +0000100RUN \
101`# Common Lisp (sbcl) dependencies` \
102 curl --version && \
James E. King IIIabf3aa52019-01-04 17:21:02 -0500103 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 IIIf5f430d2018-06-08 03:37:55 +0000104 tar xjf sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2 && \
105 cd sbcl-${SBCL_VERSION}-x86-64-linux && \
106 ./install.sh && \
107 sbcl --version && \
108 cd .. && \
109 rm -rf sbcl*
110
James E. King IIIabf3aa52019-01-04 17:21:02 -0500111ENV D_VERSION 2.083.1
112ENV DMD_DEB dmd_2.083.1-0_amd64.deb
James E. King IIIf5f430d2018-06-08 03:37:55 +0000113RUN \
114`# D dependencies` \
115 wget -q http://downloads.dlang.org/releases/2.x/${D_VERSION}/${DMD_DEB} && \
116 dpkg --install ${DMD_DEB} && \
117 rm -f ${DMD_DEB} && \
118 mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
James E. King IIIabf3aa52019-01-04 17:21:02 -0500119 git clone -b 'v2.0.2+2.0.16' https://github.com/D-Programming-Deimos/libevent.git deimos-libevent-2.0 && \
120 mv deimos-libevent-2.0/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
121 mv deimos-libevent-2.0/C/* /usr/include/dmd/druntime/import/C/ && \
122 rm -rf deimos-libevent-2.0 && \
James E. King III75bac102018-12-30 16:20:12 -0500123 git clone -b 'v2.0.0+1.1.0h' https://github.com/D-Programming-Deimos/openssl.git deimos-openssl-1.1.0h && \
124 mv deimos-openssl-1.1.0h/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
125 mv deimos-openssl-1.1.0h/C/* /usr/include/dmd/druntime/import/C/ && \
126 rm -rf deimos-openssl-1.1.0h
James E. King IIIf5f430d2018-06-08 03:37:55 +0000127
Rob Beckerf1eadad2019-01-21 20:24:01 -0700128ENV DART_VERSION 2.1.0-1
James E. King IIIf5f430d2018-06-08 03:37:55 +0000129RUN apt-get install -y --no-install-recommends \
130 `# Dart dependencies` \
Brian Forbisc64389a2018-09-22 07:36:24 -0400131 dart=$DART_VERSION
James E. King IIIf5f430d2018-06-08 03:37:55 +0000132ENV PATH /usr/lib/dart/bin:$PATH
133
134RUN apt-get install -y --no-install-recommends \
135`# dotnet core dependencies` \
James E. King IIIabf3aa52019-01-04 17:21:02 -0500136 dotnet-sdk-2.2
James E. King IIIf5f430d2018-06-08 03:37:55 +0000137
138RUN apt-get install -y --no-install-recommends \
139`# Erlang dependencies` \
140 erlang-base \
141 erlang-eunit \
142 erlang-dev \
143 erlang-tools \
144 rebar
145
146RUN apt-get install -y --no-install-recommends \
147`# GlibC dependencies` \
148 libglib2.0-dev
149
150# golang
James E. King IIIabf3aa52019-01-04 17:21:02 -0500151ENV GOLANG_VERSION 1.11.4
James E. King IIIf5f430d2018-06-08 03:37:55 +0000152ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
James E. King IIIabf3aa52019-01-04 17:21:02 -0500153ENV GOLANG_DOWNLOAD_SHA256 fb26c30e6a04ad937bbc657a1b5bba92f80096af1e8ee6da6430c045a8db3a5b
James E. King IIIf5f430d2018-06-08 03:37:55 +0000154RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \
155 echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \
156 tar -C /usr/local -xzf golang.tar.gz && \
157 ln -s /usr/local/go/bin/go /usr/local/bin && \
158 rm golang.tar.gz
159
160RUN apt-get install -y --no-install-recommends \
161`# Haskell dependencies` \
162 ghc \
163 cabal-install
164
165RUN apt-get install -y --no-install-recommends \
166`# Haxe dependencies` \
167 haxe \
168 neko \
169 neko-dev && \
170 haxelib setup --always /usr/share/haxe/lib && \
171 haxelib install --always hxcpp 2>&1 > /dev/null
172
173RUN apt-get install -y --no-install-recommends \
174`# Java dependencies` \
175 ant \
176 ant-optional \
177 openjdk-8-jdk \
178 maven && \
179 update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
180
181RUN apt-get install -y --no-install-recommends \
182`# Lua dependencies` \
183 lua5.2 \
184 lua5.2-dev
185# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
186# lua5.3 does not install alternatives!
187# need to update our luasocket code, lua doesn't have luaL_openlib any more
188
189RUN apt-get install -y --no-install-recommends \
190`# Node.js dependencies` \
191 nodejs
192
Brian Forbisb5d6ea32018-08-25 23:39:29 -0400193# Test dependencies for running puppeteer
194RUN apt-get install -y --no-install-recommends \
195`# JS dependencies` \
196 libxss1
197
James E. King IIIf5f430d2018-06-08 03:37:55 +0000198RUN apt-get install -y --no-install-recommends \
199`# OCaml dependencies` \
200 ocaml \
201 opam && \
202 opam init --yes && \
203 opam install --yes oasis
204
205RUN apt-get install -y --no-install-recommends \
206`# Perl dependencies` \
207 libbit-vector-perl \
208 libclass-accessor-class-perl \
209 libcrypt-ssleay-perl \
210 libio-socket-ssl-perl \
211 libnet-ssleay-perl
212
213RUN apt-get install -y --no-install-recommends \
214`# Php dependencies` \
215 php \
216 php-cli \
217 php-dev \
218 php-pear \
219 re2c \
220 composer
221
222RUN apt-get install -y --no-install-recommends \
223`# Python dependencies` \
224 python-all \
225 python-all-dbg \
226 python-all-dev \
227 python-ipaddress \
228 python-pip \
229 python-setuptools \
230 python-six \
231 python-tornado \
232 python-twisted \
233 python-wheel \
234 python-zope.interface && \
235 pip install --upgrade backports.ssl_match_hostname
236
237RUN apt-get install -y --no-install-recommends \
238`# Python3 dependencies` \
239 python3-all \
240 python3-all-dbg \
241 python3-all-dev \
242 python3-pip \
243 python3-setuptools \
244 python3-six \
245 python3-tornado \
246 python3-twisted \
247 python3-wheel \
248 python3-zope.interface
249
250RUN apt-get install -y --no-install-recommends \
251`# Ruby dependencies` \
252 ruby \
253 ruby-dev \
254 ruby-bundler
255
256RUN apt-get install -y --no-install-recommends \
257`# Rust dependencies` \
258 cargo \
259 rustc
260
James E. King IIIa3a7c6c2018-12-31 17:17:34 -0500261# Swift on Linux for cross tests
262RUN cd / && \
263 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 && \
264 tar xf swift-4.2.1-RELEASE-ubuntu18.04.tar.gz --strip-components=1 && \
265 rm swift-4.2.1-RELEASE-ubuntu18.04.tar.gz && \
266 swift --version
267
James E. King IIIf5f430d2018-06-08 03:37:55 +0000268# cppcheck-1.82 has a nasty cpp parser bug, so we're using something newer
269RUN apt-get install -y --no-install-recommends \
270`# Static Code Analysis dependencies` \
271 cppcheck \
272 sloccount && \
273 pip install flake8 && \
274 wget -q "https://launchpad.net/ubuntu/+source/cppcheck/1.83-2/+build/14874703/+files/cppcheck_1.83-2_amd64.deb" && \
275 dpkg -i cppcheck_1.83-2_amd64.deb && \
276 rm cppcheck_1.83-2_amd64.deb
277
278# Clean up
279RUN rm -rf /var/cache/apt/* && \
280 rm -rf /var/lib/apt/lists/* && \
281 rm -rf /tmp/* && \
282 rm -rf /var/tmp/*
283
284ENV THRIFT_ROOT /thrift
285RUN mkdir -p $THRIFT_ROOT/src
286COPY Dockerfile $THRIFT_ROOT/
287WORKDIR $THRIFT_ROOT/src