blob: b508b1e8deb151089d0e14a729b463a9abcf93a5 [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 \
Fokko Driesprong1686c872019-02-01 20:31:58 +010071 libasound2 \
72 libatk-bridge2.0-0 \
73 libgtk-3-0 \
James E. King IIIf5f430d2018-06-08 03:37:55 +000074 llvm \
75 ninja-build \
76 pkg-config \
James E. King IIIb1d63e72019-01-22 14:16:39 -050077 unzip \
James E. King IIIf5f430d2018-06-08 03:37:55 +000078 valgrind \
79 vim
80ENV PATH /usr/lib/llvm-6.0/bin:$PATH
81
James E. King IIIb1d63e72019-01-22 14:16:39 -050082# lib/as3 (ActionScript)
83RUN 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
87ENV FLEX_HOME /usr/local/adobe/flex/4.6
88
James E. King IIIf5f430d2018-06-08 03:37:55 +000089RUN 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
98RUN apt-get install -y --no-install-recommends \
99`# csharp (mono) dependencies` \
100 mono-devel
101
James E. King IIIabf3aa52019-01-04 17:21:02 -0500102ENV SBCL_VERSION 1.4.15
James E. King IIIf5f430d2018-06-08 03:37:55 +0000103RUN \
104`# Common Lisp (sbcl) dependencies` \
105 curl --version && \
James E. King IIIabf3aa52019-01-04 17:21:02 -0500106 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 +0000107 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 IIIabf3aa52019-01-04 17:21:02 -0500114ENV D_VERSION 2.083.1
115ENV DMD_DEB dmd_2.083.1-0_amd64.deb
James E. King IIIf5f430d2018-06-08 03:37:55 +0000116RUN \
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 IIIabf3aa52019-01-04 17:21:02 -0500122 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 III75bac102018-12-30 16:20:12 -0500126 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 IIIf5f430d2018-06-08 03:37:55 +0000130
Rob Beckerf1eadad2019-01-21 20:24:01 -0700131ENV DART_VERSION 2.1.0-1
James E. King IIIf5f430d2018-06-08 03:37:55 +0000132RUN apt-get install -y --no-install-recommends \
133 `# Dart dependencies` \
Brian Forbisc64389a2018-09-22 07:36:24 -0400134 dart=$DART_VERSION
James E. King IIIf5f430d2018-06-08 03:37:55 +0000135ENV PATH /usr/lib/dart/bin:$PATH
136
137RUN apt-get install -y --no-install-recommends \
138`# dotnet core dependencies` \
James E. King IIIabf3aa52019-01-04 17:21:02 -0500139 dotnet-sdk-2.2
James E. King IIIf5f430d2018-06-08 03:37:55 +0000140
141RUN 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
149RUN apt-get install -y --no-install-recommends \
150`# GlibC dependencies` \
151 libglib2.0-dev
152
153# golang
James E. King III3b779822019-03-15 15:59:27 -0400154ENV GOLANG_VERSION 1.12.1
James E. King IIIf5f430d2018-06-08 03:37:55 +0000155ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
James E. King III3b779822019-03-15 15:59:27 -0400156ENV GOLANG_DOWNLOAD_SHA256 2a3fdabf665496a0db5f41ec6af7a9b15a49fbe71a85a50ca38b1f13a103aeec
James E. King IIIf5f430d2018-06-08 03:37:55 +0000157RUN 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
163RUN apt-get install -y --no-install-recommends \
164`# Haskell dependencies` \
165 ghc \
166 cabal-install
167
168RUN 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
176RUN apt-get install -y --no-install-recommends \
177`# Java dependencies` \
178 ant \
179 ant-optional \
Fokko Driesprong1686c872019-02-01 20:31:58 +0100180 maven \
181 openjdk-11-jdk-headless
James E. King IIIf5f430d2018-06-08 03:37:55 +0000182
183RUN 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
191RUN apt-get install -y --no-install-recommends \
192`# Node.js dependencies` \
193 nodejs
194
Brian Forbisb5d6ea32018-08-25 23:39:29 -0400195# Test dependencies for running puppeteer
196RUN apt-get install -y --no-install-recommends \
197`# JS dependencies` \
198 libxss1
199
James E. King IIIf5f430d2018-06-08 03:37:55 +0000200RUN apt-get install -y --no-install-recommends \
201`# OCaml dependencies` \
202 ocaml \
203 opam && \
204 opam init --yes && \
205 opam install --yes oasis
206
207RUN 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
215RUN apt-get install -y --no-install-recommends \
216`# Php dependencies` \
217 php \
218 php-cli \
219 php-dev \
James E. King IIIe53d23c2019-02-10 11:13:23 -0500220 php-json \
James E. King IIIf5f430d2018-06-08 03:37:55 +0000221 php-pear \
222 re2c \
223 composer
224
225RUN 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
240RUN 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
253RUN apt-get install -y --no-install-recommends \
254`# Ruby dependencies` \
255 ruby \
256 ruby-dev \
257 ruby-bundler
258
Danny Browning181d9002019-04-15 09:50:24 -0600259# Rust dependencies
Allen Georgec2c1e1d2019-07-01 07:46:04 -0400260RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.35.0 -y
James E. King IIIf5f430d2018-06-08 03:37:55 +0000261
James E. King IIIa3a7c6c2018-12-31 17:17:34 -0500262# Swift on Linux for cross tests
263RUN 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 IIIf5f430d2018-06-08 03:37:55 +0000269# cppcheck-1.82 has a nasty cpp parser bug, so we're using something newer
270RUN 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
280RUN rm -rf /var/cache/apt/* && \
281 rm -rf /var/lib/apt/lists/* && \
282 rm -rf /tmp/* && \
283 rm -rf /var/tmp/*
284
285ENV THRIFT_ROOT /thrift
286RUN mkdir -p $THRIFT_ROOT/src
287COPY Dockerfile $THRIFT_ROOT/
288WORKDIR $THRIFT_ROOT/src