blob: 416d75e6c2618420c7df80615cc9199d8aba5008 [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 IIIa37feaf2018-03-06 15:11:01 -050022#
James E. King, III0ad20bd2017-09-30 15:44:16 -070023
24FROM buildpack-deps:artful-scm
25MAINTAINER Apache Thrift <dev@thrift.apache.org>
26ENV DEBIAN_FRONTEND noninteractive
27
Robert Lu31d5b7b2018-01-05 13:44:38 +080028### Add apt repos
29
Robert Lua15060a2017-12-28 15:29:39 +080030RUN apt-get update && \
31 apt-get dist-upgrade -y && \
James E. King, III0ad20bd2017-09-30 15:44:16 -070032 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
Robert Lu31d5b7b2018-01-05 13:44:38 +080045# 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
James E. King, III0ad20bd2017-09-30 15:44:16 -070049
James E. King IIId907cc92018-01-12 10:43:25 -050050# dotnet (netcore)
51RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \
52 echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-artful-prod artful main" > \
53 /etc/apt/sources.list.d/dotnetdev.list
54
55# haxe (https://haxe.org/download/linux/)
56RUN add-apt-repository ppa:haxe/releases -y
57
58# node.js
James E. King III78755f52018-03-06 09:50:33 -050059RUN curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
James E. King IIId907cc92018-01-12 10:43:25 -050060 echo "deb https://deb.nodesource.com/node_8.x artful main" | tee /etc/apt/sources.list.d/nodesource.list
61
James E. King, III0ad20bd2017-09-30 15:44:16 -070062### install general dependencies
Robert Lu31d5b7b2018-01-05 13:44:38 +080063RUN apt-get update && apt-get install -y --no-install-recommends \
James E. King, III0ad20bd2017-09-30 15:44:16 -070064`# General dependencies` \
65 bash-completion \
66 bison \
67 build-essential \
68 clang \
69 cmake \
70 debhelper \
71 flex \
72 gdb \
73 llvm \
74 ninja-build \
75 pkg-config \
76 valgrind \
77 vim
78ENV PATH /usr/lib/llvm-3.8/bin:$PATH
79
80# boost-1.62 has a terrible bug in boost::test, see https://svn.boost.org/trac10/ticket/12507
81RUN apt-get install -y --no-install-recommends \
82`# C++ dependencies` \
83 libboost1.63-all-dev \
84 libevent-dev \
85 libssl-dev \
86 qt5-default \
87 qtbase5-dev \
88 qtbase5-dev-tools
89
90RUN apt-get install -y --no-install-recommends \
91`# csharp (mono) dependencies` \
92 mono-devel
93
James E. King IIIbf7f76b2018-02-28 17:11:05 -050094ENV SBCL_VERSION 1.4.4
95RUN \
Tomek Kurcze93a9012017-09-19 09:16:43 +020096`# Common Lisp (sbcl) dependencies` \
James E. King IIIbf7f76b2018-02-28 17:11:05 -050097 curl --version && \
98 curl -O -J -L https://kent.dl.sourceforge.net/project/sbcl/sbcl/${SBCL_VERSION}/sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2 && \
99 tar xjf sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2 && \
100 cd sbcl-${SBCL_VERSION}-x86-64-linux && \
101 ./install.sh && \
102 sbcl --version && \
103 rm -rf sbcl*
Tomek Kurcze93a9012017-09-19 09:16:43 +0200104
James E. King IIIbf7f76b2018-02-28 17:11:05 -0500105ENV D_VERSION 2.077.1
106ENV DMD_DEB dmd_2.077.1-0_amd64.deb
107RUN \
108`# D dependencies` \
109 wget -q http://downloads.dlang.org/releases/2.x/${D_VERSION}/${DMD_DEB} && \
110 dpkg --install ${DMD_DEB} && \
111 rm -f ${DMD_DEB} && \
112 mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
James E. King IIIf338d572018-01-29 14:51:24 -0500113 curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
114 mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
115 mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \
James E. King IIIbf7f76b2018-02-28 17:11:05 -0500116 rm -rf libevent-master && \
117 curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
James E. King IIIf338d572018-01-29 14:51:24 -0500118 mv openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
119 mv openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
120 rm -rf openssl-master
James E. King, III0ad20bd2017-09-30 15:44:16 -0700121
Robert Lu31d5b7b2018-01-05 13:44:38 +0800122RUN apt-get install -y --no-install-recommends \
Robert Luc72d8dc2017-12-29 04:14:38 +0800123 `# Dart dependencies` \
124 dart/stable
James E. King, III6e883f92017-11-18 21:18:05 -0500125ENV PATH /usr/lib/dart/bin:$PATH
James E. King, III0ad20bd2017-09-30 15:44:16 -0700126
James E. King, III6e883f92017-11-18 21:18:05 -0500127RUN apt-get install -y --no-install-recommends \
128`# dotnet core dependencies` \
James E. King IIIf338d572018-01-29 14:51:24 -0500129 dotnet-sdk-2.1.4
James E. King, III0ad20bd2017-09-30 15:44:16 -0700130
131RUN apt-get install -y --no-install-recommends \
132`# Erlang dependencies` \
133 erlang-base \
134 erlang-eunit \
135 erlang-dev \
136 erlang-tools \
137 rebar
138
139RUN apt-get install -y --no-install-recommends \
140`# GlibC dependencies` \
141 libglib2.0-dev
142
143RUN apt-get install -y --no-install-recommends \
144`# golang (go) dependencies` \
145 golang-go \
146 golang-race-detector-runtime
147
148RUN apt-get install -y --no-install-recommends \
149`# Haskell dependencies` \
150 ghc \
151 cabal-install
152
James E. King IIId907cc92018-01-12 10:43:25 -0500153RUN apt-get install -y --no-install-recommends \
154`# Haxe dependencies` \
155 haxe \
156 neko \
157 neko-dev && \
158 haxelib setup --always /usr/share/haxe/lib && \
159 haxelib install --always hxcpp 2>&1 > /dev/null
James E. King, III0ad20bd2017-09-30 15:44:16 -0700160
161RUN apt-get install -y --no-install-recommends \
162`# Java dependencies` \
163 ant \
164 ant-optional \
165 openjdk-8-jdk \
166 maven
167
168RUN apt-get install -y --no-install-recommends \
169`# Lua dependencies` \
James E. King, III39eaae62017-11-19 20:17:33 -0500170 lua5.2 \
171 lua5.2-dev
James E. King, III0ad20bd2017-09-30 15:44:16 -0700172# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
173# lua5.3 does not install alternatives!
James E. King, III39eaae62017-11-19 20:17:33 -0500174# need to update our luasocket code, lua doesn't have luaL_openlib any more
James E. King, III0ad20bd2017-09-30 15:44:16 -0700175
176RUN apt-get install -y --no-install-recommends \
177`# Node.js dependencies` \
James E. King, III619218c2017-10-29 06:55:00 -0400178 nodejs
James E. King, III0ad20bd2017-09-30 15:44:16 -0700179
180RUN apt-get install -y --no-install-recommends \
181`# OCaml dependencies` \
182 ocaml \
183 opam && \
184 opam init --yes && \
185 opam install --yes oasis
186
187RUN apt-get install -y --no-install-recommends \
188`# Perl dependencies` \
189 libbit-vector-perl \
190 libclass-accessor-class-perl \
191 libcrypt-ssleay-perl \
192 libio-socket-ssl-perl \
193 libnet-ssleay-perl
194
195RUN apt-get install -y --no-install-recommends \
196`# Php dependencies` \
197 php \
198 php-cli \
199 php-dev \
200 php-pear \
201 re2c \
Robert Lua15060a2017-12-28 15:29:39 +0800202 composer
James E. King, III0ad20bd2017-09-30 15:44:16 -0700203
204RUN apt-get install -y --no-install-recommends \
205`# Python dependencies` \
206 python-all \
207 python-all-dbg \
208 python-all-dev \
209 python-ipaddress \
210 python-pip \
211 python-setuptools \
212 python-six \
213 python-tornado \
214 python-twisted \
215 python-wheel \
216 python-zope.interface && \
217 pip install --upgrade backports.ssl_match_hostname
218
219RUN apt-get install -y --no-install-recommends \
220`# Python3 dependencies` \
221 python3-all \
222 python3-all-dbg \
223 python3-all-dev \
224 python3-pip \
225 python3-setuptools \
226 python3-six \
227 python3-tornado \
228 python3-twisted \
229 python3-wheel \
230 python3-zope.interface
231
232RUN apt-get install -y --no-install-recommends \
233`# Ruby dependencies` \
234 ruby \
235 ruby-dev \
236 ruby-bundler
237RUN gem install bundler --no-ri --no-rdoc
238
239RUN apt-get install -y --no-install-recommends \
240`# Rust dependencies` \
241 cargo \
242 rustc
243
244RUN apt-get install -y --no-install-recommends \
245`# Static Code Analysis dependencies` \
246 cppcheck \
247 sloccount && \
248 pip install flake8
249
250# Clean up
251RUN rm -rf /var/cache/apt/* && \
252 rm -rf /var/lib/apt/lists/* && \
253 rm -rf /tmp/* && \
254 rm -rf /var/tmp/*
255
256ENV THRIFT_ROOT /thrift
257RUN mkdir -p $THRIFT_ROOT/src
258COPY Dockerfile $THRIFT_ROOT/
259WORKDIR $THRIFT_ROOT/src