blob: ac3b259fd917b3734a1739cb78dc6fdb605e5736 [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:
16# - d: dmd does not come with Ubuntu
17# - dart: does not come with Ubuntu
18# - dotnet: does not come with Ubuntu
19# - go: want latest
20# - nodejs: want v8, bionic comes with v6
21# - openssl: to support dlang and the deimos for openssl, need to use 1.0 not 1.1
22#
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
78# boost-1.62 has a terrible bug in boost::test, see https://svn.boost.org/trac10/ticket/12507
79RUN apt-get install -y --no-install-recommends \
80`# C++ dependencies` \
81 libboost-all-dev \
82 libevent-dev \
83 libssl-dev \
84 qt5-default \
85 qtbase5-dev \
86 qtbase5-dev-tools
87
88RUN apt-get install -y --no-install-recommends \
89`# csharp (mono) dependencies` \
90 mono-devel
91
92ENV SBCL_VERSION 1.4.8
93RUN \
94`# Common Lisp (sbcl) dependencies` \
95 curl --version && \
96 curl -O -J -L https://kent.dl.sourceforge.net/project/sbcl/sbcl/${SBCL_VERSION}/sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2 && \
97 tar xjf sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2 && \
98 cd sbcl-${SBCL_VERSION}-x86-64-linux && \
99 ./install.sh && \
100 sbcl --version && \
101 cd .. && \
102 rm -rf sbcl*
103
104ENV D_VERSION 2.080.0
105ENV DMD_DEB dmd_2.080.0-0_amd64.deb
106RUN \
107`# D dependencies` \
108 wget -q http://downloads.dlang.org/releases/2.x/${D_VERSION}/${DMD_DEB} && \
109 dpkg --install ${DMD_DEB} && \
110 rm -f ${DMD_DEB} && \
111 mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
112 curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
113 mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
114 mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \
115 rm -rf libevent-master && \
116 curl -sSL https://github.com/jeking3/openssl/archive/tls_method.tar.gz| tar xz && \
117 mv openssl-tls_method/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
118 mv openssl-tls_method/C/* /usr/include/dmd/druntime/import/C/ && \
119 rm -rf openssl-tls_method
120
121RUN apt-get install -y --no-install-recommends \
122 `# Dart dependencies` \
123 dart/stable
124ENV PATH /usr/lib/dart/bin:$PATH
125
126RUN apt-get install -y --no-install-recommends \
127`# dotnet core dependencies` \
128 dotnet-sdk-2.1
129
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
143ENV GOLANG_VERSION 1.10.2
144ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
145ENV GOLANG_DOWNLOAD_SHA256 4b677d698c65370afa33757b6954ade60347aaca310ea92a63ed717d7cb0c2ff
146RUN 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
185RUN apt-get install -y --no-install-recommends \
186`# OCaml dependencies` \
187 ocaml \
188 opam && \
189 opam init --yes && \
190 opam install --yes oasis
191
192RUN apt-get install -y --no-install-recommends \
193`# Perl dependencies` \
194 libbit-vector-perl \
195 libclass-accessor-class-perl \
196 libcrypt-ssleay-perl \
197 libio-socket-ssl-perl \
198 libnet-ssleay-perl
199
200RUN apt-get install -y --no-install-recommends \
201`# Php dependencies` \
202 php \
203 php-cli \
204 php-dev \
205 php-pear \
206 re2c \
207 composer
208
209RUN apt-get install -y --no-install-recommends \
210`# Python dependencies` \
211 python-all \
212 python-all-dbg \
213 python-all-dev \
214 python-ipaddress \
215 python-pip \
216 python-setuptools \
217 python-six \
218 python-tornado \
219 python-twisted \
220 python-wheel \
221 python-zope.interface && \
222 pip install --upgrade backports.ssl_match_hostname
223
224RUN apt-get install -y --no-install-recommends \
225`# Python3 dependencies` \
226 python3-all \
227 python3-all-dbg \
228 python3-all-dev \
229 python3-pip \
230 python3-setuptools \
231 python3-six \
232 python3-tornado \
233 python3-twisted \
234 python3-wheel \
235 python3-zope.interface
236
237RUN apt-get install -y --no-install-recommends \
238`# Ruby dependencies` \
239 ruby \
240 ruby-dev \
241 ruby-bundler
242
243RUN apt-get install -y --no-install-recommends \
244`# Rust dependencies` \
245 cargo \
246 rustc
247
248# cppcheck-1.82 has a nasty cpp parser bug, so we're using something newer
249RUN apt-get install -y --no-install-recommends \
250`# Static Code Analysis dependencies` \
251 cppcheck \
252 sloccount && \
253 pip install flake8 && \
254 wget -q "https://launchpad.net/ubuntu/+source/cppcheck/1.83-2/+build/14874703/+files/cppcheck_1.83-2_amd64.deb" && \
255 dpkg -i cppcheck_1.83-2_amd64.deb && \
256 rm cppcheck_1.83-2_amd64.deb
257
258# Clean up
259RUN rm -rf /var/cache/apt/* && \
260 rm -rf /var/lib/apt/lists/* && \
261 rm -rf /tmp/* && \
262 rm -rf /var/tmp/*
263
264ENV THRIFT_ROOT /thrift
265RUN mkdir -p $THRIFT_ROOT/src
266COPY Dockerfile $THRIFT_ROOT/
267WORKDIR $THRIFT_ROOT/src