blob: db19112e89f06a2981f0158537a0bfe7dc413753 [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 \
74 valgrind \
75 vim
76ENV PATH /usr/lib/llvm-6.0/bin:$PATH
77
James E. King IIIf5f430d2018-06-08 03:37:55 +000078RUN apt-get install -y --no-install-recommends \
79`# C++ dependencies` \
80 libboost-all-dev \
81 libevent-dev \
82 libssl-dev \
83 qt5-default \
84 qtbase5-dev \
85 qtbase5-dev-tools
86
87RUN apt-get install -y --no-install-recommends \
88`# csharp (mono) dependencies` \
89 mono-devel
90
James E. King IIIabf3aa52019-01-04 17:21:02 -050091ENV SBCL_VERSION 1.4.15
James E. King IIIf5f430d2018-06-08 03:37:55 +000092RUN \
93`# Common Lisp (sbcl) dependencies` \
94 curl --version && \
James E. King IIIabf3aa52019-01-04 17:21:02 -050095 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 +000096 tar xjf sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2 && \
97 cd sbcl-${SBCL_VERSION}-x86-64-linux && \
98 ./install.sh && \
99 sbcl --version && \
100 cd .. && \
101 rm -rf sbcl*
102
James E. King IIIabf3aa52019-01-04 17:21:02 -0500103ENV D_VERSION 2.083.1
104ENV DMD_DEB dmd_2.083.1-0_amd64.deb
James E. King IIIf5f430d2018-06-08 03:37:55 +0000105RUN \
106`# D dependencies` \
107 wget -q http://downloads.dlang.org/releases/2.x/${D_VERSION}/${DMD_DEB} && \
108 dpkg --install ${DMD_DEB} && \
109 rm -f ${DMD_DEB} && \
110 mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
James E. King IIIabf3aa52019-01-04 17:21:02 -0500111 git clone -b 'v2.0.2+2.0.16' https://github.com/D-Programming-Deimos/libevent.git deimos-libevent-2.0 && \
112 mv deimos-libevent-2.0/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
113 mv deimos-libevent-2.0/C/* /usr/include/dmd/druntime/import/C/ && \
114 rm -rf deimos-libevent-2.0 && \
James E. King III75bac102018-12-30 16:20:12 -0500115 git clone -b 'v2.0.0+1.1.0h' https://github.com/D-Programming-Deimos/openssl.git deimos-openssl-1.1.0h && \
116 mv deimos-openssl-1.1.0h/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
117 mv deimos-openssl-1.1.0h/C/* /usr/include/dmd/druntime/import/C/ && \
118 rm -rf deimos-openssl-1.1.0h
James E. King IIIf5f430d2018-06-08 03:37:55 +0000119
Rob Beckerf1eadad2019-01-21 20:24:01 -0700120ENV DART_VERSION 2.1.0-1
James E. King IIIf5f430d2018-06-08 03:37:55 +0000121RUN apt-get install -y --no-install-recommends \
122 `# Dart dependencies` \
Brian Forbisc64389a2018-09-22 07:36:24 -0400123 dart=$DART_VERSION
James E. King IIIf5f430d2018-06-08 03:37:55 +0000124ENV PATH /usr/lib/dart/bin:$PATH
125
126RUN apt-get install -y --no-install-recommends \
127`# dotnet core dependencies` \
James E. King IIIabf3aa52019-01-04 17:21:02 -0500128 dotnet-sdk-2.2
James E. King IIIf5f430d2018-06-08 03:37:55 +0000129
130RUN apt-get install -y --no-install-recommends \
131`# Erlang dependencies` \
132 erlang-base \
133 erlang-eunit \
134 erlang-dev \
135 erlang-tools \
136 rebar
137
138RUN apt-get install -y --no-install-recommends \
139`# GlibC dependencies` \
140 libglib2.0-dev
141
142# golang
James E. King IIIabf3aa52019-01-04 17:21:02 -0500143ENV GOLANG_VERSION 1.11.4
James E. King IIIf5f430d2018-06-08 03:37:55 +0000144ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
James E. King IIIabf3aa52019-01-04 17:21:02 -0500145ENV GOLANG_DOWNLOAD_SHA256 fb26c30e6a04ad937bbc657a1b5bba92f80096af1e8ee6da6430c045a8db3a5b
James E. King IIIf5f430d2018-06-08 03:37:55 +0000146RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \
147 echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \
148 tar -C /usr/local -xzf golang.tar.gz && \
149 ln -s /usr/local/go/bin/go /usr/local/bin && \
150 rm golang.tar.gz
151
152RUN apt-get install -y --no-install-recommends \
153`# Haskell dependencies` \
154 ghc \
155 cabal-install
156
157RUN apt-get install -y --no-install-recommends \
158`# Haxe dependencies` \
159 haxe \
160 neko \
161 neko-dev && \
162 haxelib setup --always /usr/share/haxe/lib && \
163 haxelib install --always hxcpp 2>&1 > /dev/null
164
165RUN apt-get install -y --no-install-recommends \
166`# Java dependencies` \
167 ant \
168 ant-optional \
169 openjdk-8-jdk \
170 maven && \
171 update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
172
173RUN apt-get install -y --no-install-recommends \
174`# Lua dependencies` \
175 lua5.2 \
176 lua5.2-dev
177# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
178# lua5.3 does not install alternatives!
179# need to update our luasocket code, lua doesn't have luaL_openlib any more
180
181RUN apt-get install -y --no-install-recommends \
182`# Node.js dependencies` \
183 nodejs
184
Brian Forbisb5d6ea32018-08-25 23:39:29 -0400185# Test dependencies for running puppeteer
186RUN apt-get install -y --no-install-recommends \
187`# JS dependencies` \
188 libxss1
189
James E. King IIIf5f430d2018-06-08 03:37:55 +0000190RUN apt-get install -y --no-install-recommends \
191`# OCaml dependencies` \
192 ocaml \
193 opam && \
194 opam init --yes && \
195 opam install --yes oasis
196
197RUN apt-get install -y --no-install-recommends \
198`# Perl dependencies` \
199 libbit-vector-perl \
200 libclass-accessor-class-perl \
201 libcrypt-ssleay-perl \
202 libio-socket-ssl-perl \
203 libnet-ssleay-perl
204
205RUN apt-get install -y --no-install-recommends \
206`# Php dependencies` \
207 php \
208 php-cli \
209 php-dev \
210 php-pear \
211 re2c \
212 composer
213
214RUN apt-get install -y --no-install-recommends \
215`# Python dependencies` \
216 python-all \
217 python-all-dbg \
218 python-all-dev \
219 python-ipaddress \
220 python-pip \
221 python-setuptools \
222 python-six \
223 python-tornado \
224 python-twisted \
225 python-wheel \
226 python-zope.interface && \
227 pip install --upgrade backports.ssl_match_hostname
228
229RUN apt-get install -y --no-install-recommends \
230`# Python3 dependencies` \
231 python3-all \
232 python3-all-dbg \
233 python3-all-dev \
234 python3-pip \
235 python3-setuptools \
236 python3-six \
237 python3-tornado \
238 python3-twisted \
239 python3-wheel \
240 python3-zope.interface
241
242RUN apt-get install -y --no-install-recommends \
243`# Ruby dependencies` \
244 ruby \
245 ruby-dev \
246 ruby-bundler
247
248RUN apt-get install -y --no-install-recommends \
249`# Rust dependencies` \
250 cargo \
251 rustc
252
James E. King IIIa3a7c6c2018-12-31 17:17:34 -0500253# Swift on Linux for cross tests
254RUN cd / && \
255 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 && \
256 tar xf swift-4.2.1-RELEASE-ubuntu18.04.tar.gz --strip-components=1 && \
257 rm swift-4.2.1-RELEASE-ubuntu18.04.tar.gz && \
258 swift --version
259
James E. King IIIf5f430d2018-06-08 03:37:55 +0000260# cppcheck-1.82 has a nasty cpp parser bug, so we're using something newer
261RUN apt-get install -y --no-install-recommends \
262`# Static Code Analysis dependencies` \
263 cppcheck \
264 sloccount && \
265 pip install flake8 && \
266 wget -q "https://launchpad.net/ubuntu/+source/cppcheck/1.83-2/+build/14874703/+files/cppcheck_1.83-2_amd64.deb" && \
267 dpkg -i cppcheck_1.83-2_amd64.deb && \
268 rm cppcheck_1.83-2_amd64.deb
269
270# Clean up
271RUN rm -rf /var/cache/apt/* && \
272 rm -rf /var/lib/apt/lists/* && \
273 rm -rf /tmp/* && \
274 rm -rf /var/tmp/*
275
276ENV THRIFT_ROOT /thrift
277RUN mkdir -p $THRIFT_ROOT/src
278COPY Dockerfile $THRIFT_ROOT/
279WORKDIR $THRIFT_ROOT/src