blob: fe241c45f7dc6a4df50cff3659a374e8c12869a3 [file] [log] [blame]
James E. King, III0ad20bd2017-09-30 15:44:16 -07001# 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 Artful
15# Using all stock Ubuntu Artful packaging except for:
16# - cpp: stock boost 1.62 in artful has a nasty bug so we use stock boost 1.63
James E. King IIId907cc92018-01-12 10:43:25 -050017# - d: dmd does not come with Ubuntu
18# - dart: does not come with Ubuntu
19# - dotnet: does not come with Ubuntu
20# - haxe: version 3.4.2 that comes with Ubuntu cores in our CI build
21# - nodejs: want v8, Ubuntu comes with v6
James E. King, III0ad20bd2017-09-30 15:44:16 -070022
23FROM buildpack-deps:artful-scm
24MAINTAINER Apache Thrift <dev@thrift.apache.org>
25ENV DEBIAN_FRONTEND noninteractive
26
Robert Lu31d5b7b2018-01-05 13:44:38 +080027### Add apt repos
28
Robert Lua15060a2017-12-28 15:29:39 +080029RUN apt-get update && \
30 apt-get dist-upgrade -y && \
James E. King, III0ad20bd2017-09-30 15:44:16 -070031 apt-get install -y --no-install-recommends \
32 apt \
33 apt-transport-https \
34 apt-utils \
35 curl \
36 dirmngr \
37 software-properties-common \
38 wget
39
40# csharp (mono) - if we ever want a later version
41# RUN echo "deb http://download.mono-project.com/repo/debian xenial main" | tee /etc/apt/sources.list.d/mono.list && \
42# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A6A19B38D3D831EF
43
Robert Lu31d5b7b2018-01-05 13:44:38 +080044# Dart
45RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
46 curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > \
47 /etc/apt/sources.list.d/dart_stable.list
James E. King, III0ad20bd2017-09-30 15:44:16 -070048
James E. King IIId907cc92018-01-12 10:43:25 -050049# dotnet (netcore)
50RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \
51 echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-artful-prod artful main" > \
52 /etc/apt/sources.list.d/dotnetdev.list
53
54# haxe (https://haxe.org/download/linux/)
55RUN add-apt-repository ppa:haxe/releases -y
56
57# node.js
58RUN curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
59 echo "deb https://deb.nodesource.com/node_8.x artful main" | tee /etc/apt/sources.list.d/nodesource.list
60
James E. King, III0ad20bd2017-09-30 15:44:16 -070061### install general dependencies
Robert Lu31d5b7b2018-01-05 13:44:38 +080062RUN apt-get update && apt-get install -y --no-install-recommends \
James E. King, III0ad20bd2017-09-30 15:44:16 -070063`# General dependencies` \
64 bash-completion \
65 bison \
66 build-essential \
67 clang \
68 cmake \
69 debhelper \
70 flex \
71 gdb \
72 llvm \
73 ninja-build \
74 pkg-config \
75 valgrind \
76 vim
77ENV PATH /usr/lib/llvm-3.8/bin:$PATH
78
79# boost-1.62 has a terrible bug in boost::test, see https://svn.boost.org/trac10/ticket/12507
80RUN apt-get install -y --no-install-recommends \
81`# C++ dependencies` \
82 libboost1.63-all-dev \
83 libevent-dev \
84 libssl-dev \
85 qt5-default \
86 qtbase5-dev \
87 qtbase5-dev-tools
88
89RUN apt-get install -y --no-install-recommends \
90`# csharp (mono) dependencies` \
91 mono-devel
92
James E. King IIIbf7f76b2018-02-28 17:11:05 -050093ENV SBCL_VERSION 1.4.4
94RUN \
Tomek Kurcze93a9012017-09-19 09:16:43 +020095`# Common Lisp (sbcl) dependencies` \
James E. King IIIbf7f76b2018-02-28 17:11:05 -050096 curl --version && \
97 curl -O -J -L https://kent.dl.sourceforge.net/project/sbcl/sbcl/${SBCL_VERSION}/sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2 && \
98 tar xjf sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2 && \
99 cd sbcl-${SBCL_VERSION}-x86-64-linux && \
100 ./install.sh && \
101 sbcl --version && \
102 rm -rf sbcl*
Tomek Kurcze93a9012017-09-19 09:16:43 +0200103
James E. King IIIbf7f76b2018-02-28 17:11:05 -0500104ENV D_VERSION 2.077.1
105ENV DMD_DEB dmd_2.077.1-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 && \
James E. King IIIf338d572018-01-29 14:51:24 -0500112 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/ && \
James E. King IIIbf7f76b2018-02-28 17:11:05 -0500115 rm -rf libevent-master && \
116 curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
James E. King IIIf338d572018-01-29 14:51:24 -0500117 mv openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
118 mv openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
119 rm -rf openssl-master
James E. King, III0ad20bd2017-09-30 15:44:16 -0700120
Robert Lu31d5b7b2018-01-05 13:44:38 +0800121RUN apt-get install -y --no-install-recommends \
Robert Luc72d8dc2017-12-29 04:14:38 +0800122 `# Dart dependencies` \
123 dart/stable
James E. King, III6e883f92017-11-18 21:18:05 -0500124ENV PATH /usr/lib/dart/bin:$PATH
James E. King, III0ad20bd2017-09-30 15:44:16 -0700125
James E. King, III6e883f92017-11-18 21:18:05 -0500126RUN apt-get install -y --no-install-recommends \
127`# dotnet core dependencies` \
James E. King IIIf338d572018-01-29 14:51:24 -0500128 dotnet-sdk-2.1.4
James E. King, III0ad20bd2017-09-30 15:44:16 -0700129
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
142RUN apt-get install -y --no-install-recommends \
143`# golang (go) dependencies` \
144 golang-go \
145 golang-race-detector-runtime
146
147RUN apt-get install -y --no-install-recommends \
148`# Haskell dependencies` \
149 ghc \
150 cabal-install
151
James E. King IIId907cc92018-01-12 10:43:25 -0500152RUN apt-get install -y --no-install-recommends \
153`# Haxe dependencies` \
154 haxe \
155 neko \
156 neko-dev && \
157 haxelib setup --always /usr/share/haxe/lib && \
158 haxelib install --always hxcpp 2>&1 > /dev/null
James E. King, III0ad20bd2017-09-30 15:44:16 -0700159
160RUN apt-get install -y --no-install-recommends \
161`# Java dependencies` \
162 ant \
163 ant-optional \
164 openjdk-8-jdk \
165 maven
166
167RUN apt-get install -y --no-install-recommends \
168`# Lua dependencies` \
James E. King, III39eaae62017-11-19 20:17:33 -0500169 lua5.2 \
170 lua5.2-dev
James E. King, III0ad20bd2017-09-30 15:44:16 -0700171# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
172# lua5.3 does not install alternatives!
James E. King, III39eaae62017-11-19 20:17:33 -0500173# need to update our luasocket code, lua doesn't have luaL_openlib any more
James E. King, III0ad20bd2017-09-30 15:44:16 -0700174
175RUN apt-get install -y --no-install-recommends \
176`# Node.js dependencies` \
James E. King, III619218c2017-10-29 06:55:00 -0400177 nodejs
James E. King, III0ad20bd2017-09-30 15:44:16 -0700178
179RUN apt-get install -y --no-install-recommends \
180`# OCaml dependencies` \
181 ocaml \
182 opam && \
183 opam init --yes && \
184 opam install --yes oasis
185
186RUN apt-get install -y --no-install-recommends \
187`# Perl dependencies` \
188 libbit-vector-perl \
189 libclass-accessor-class-perl \
190 libcrypt-ssleay-perl \
191 libio-socket-ssl-perl \
192 libnet-ssleay-perl
193
194RUN apt-get install -y --no-install-recommends \
195`# Php dependencies` \
196 php \
197 php-cli \
198 php-dev \
199 php-pear \
200 re2c \
Robert Lua15060a2017-12-28 15:29:39 +0800201 composer
James E. King, III0ad20bd2017-09-30 15:44:16 -0700202
203RUN apt-get install -y --no-install-recommends \
204`# Python dependencies` \
205 python-all \
206 python-all-dbg \
207 python-all-dev \
208 python-ipaddress \
209 python-pip \
210 python-setuptools \
211 python-six \
212 python-tornado \
213 python-twisted \
214 python-wheel \
215 python-zope.interface && \
216 pip install --upgrade backports.ssl_match_hostname
217
218RUN apt-get install -y --no-install-recommends \
219`# Python3 dependencies` \
220 python3-all \
221 python3-all-dbg \
222 python3-all-dev \
223 python3-pip \
224 python3-setuptools \
225 python3-six \
226 python3-tornado \
227 python3-twisted \
228 python3-wheel \
229 python3-zope.interface
230
231RUN apt-get install -y --no-install-recommends \
232`# Ruby dependencies` \
233 ruby \
234 ruby-dev \
235 ruby-bundler
236RUN gem install bundler --no-ri --no-rdoc
237
238RUN apt-get install -y --no-install-recommends \
239`# Rust dependencies` \
240 cargo \
241 rustc
242
243RUN apt-get install -y --no-install-recommends \
244`# Static Code Analysis dependencies` \
245 cppcheck \
246 sloccount && \
247 pip install flake8
248
249# Clean up
250RUN rm -rf /var/cache/apt/* && \
251 rm -rf /var/lib/apt/lists/* && \
252 rm -rf /tmp/* && \
253 rm -rf /var/tmp/*
254
255ENV THRIFT_ROOT /thrift
256RUN mkdir -p $THRIFT_ROOT/src
257COPY Dockerfile $THRIFT_ROOT/
258WORKDIR $THRIFT_ROOT/src