blob: 4babc3f3ee87eb6dd6a1c0481593f429aa77ef0e [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
17# - d: does not come with Ubuntu so we're installing the latest
18# - d: deimos for libevent and openssl omitted - not compatible / build errors
James E. King, III0ad20bd2017-09-30 15:44:16 -070019# - haxe: see THRIFT-4352, but test/haxe cores during testing
20# and hxcpp 3.4.64 is not compatible with artful
21#
22
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
James E. King, III6e883f92017-11-18 21:18:05 -050044# dotnet (core)
45RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \
Robert Lu31d5b7b2018-01-05 13:44:38 +080046 echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-artful-prod artful main" > \
47 /etc/apt/sources.list.d/dotnetdev.list
James E. King, III0ad20bd2017-09-30 15:44:16 -070048
Robert Lu31d5b7b2018-01-05 13:44:38 +080049# node.js
50RUN curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
51 echo "deb https://deb.nodesource.com/node_8.x artful main" | tee /etc/apt/sources.list.d/nodesource.list
52
53# D
54RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EBCF975E5BA24D5E && \
55 wget http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list && \
56 wget -qO - https://dlang.org/d-keyring.gpg | apt-key add -
57
58# Dart
59RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
60 curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > \
61 /etc/apt/sources.list.d/dart_stable.list
James E. King, III0ad20bd2017-09-30 15:44:16 -070062
63### install general dependencies
Robert Lu31d5b7b2018-01-05 13:44:38 +080064RUN apt-get update && apt-get install -y --no-install-recommends \
James E. King, III0ad20bd2017-09-30 15:44:16 -070065`# General dependencies` \
66 bash-completion \
67 bison \
68 build-essential \
69 clang \
70 cmake \
71 debhelper \
72 flex \
73 gdb \
74 llvm \
75 ninja-build \
76 pkg-config \
77 valgrind \
78 vim
79ENV PATH /usr/lib/llvm-3.8/bin:$PATH
80
81# boost-1.62 has a terrible bug in boost::test, see https://svn.boost.org/trac10/ticket/12507
82RUN apt-get install -y --no-install-recommends \
83`# C++ dependencies` \
84 libboost1.63-all-dev \
85 libevent-dev \
86 libssl-dev \
87 qt5-default \
88 qtbase5-dev \
89 qtbase5-dev-tools
90
91RUN apt-get install -y --no-install-recommends \
92`# csharp (mono) dependencies` \
93 mono-devel
94
James E. King IIIf338d572018-01-29 14:51:24 -050095ENV D_VERSION 2.077.1-0.1
Robert Lu31d5b7b2018-01-05 13:44:38 +080096RUN apt-get install -y --no-install-recommends \
James E. King, III0ad20bd2017-09-30 15:44:16 -070097 `# D dependencies` \
James E. King IIIf338d572018-01-29 14:51:24 -050098 dmd-bin=$D_VERSION \
99 libphobos2-dev=$D_VERSION \
100 dmd-compiler=$D_VERSION \
101 dmd-tools=$D_VERSION \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700102 dub \
103 dfmt \
104 dscanner \
105 libevent-dev \
106 libssl-dev \
107 xdg-utils
James E. King IIIf338d572018-01-29 14:51:24 -0500108RUN mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
109 curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
110 mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
111 mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \
112 rm -rf libevent-master
113RUN curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
114 mv openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
115 mv openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
116 rm -rf openssl-master
James E. King, III0ad20bd2017-09-30 15:44:16 -0700117
Robert Lu31d5b7b2018-01-05 13:44:38 +0800118RUN apt-get install -y --no-install-recommends \
Robert Luc72d8dc2017-12-29 04:14:38 +0800119 `# Dart dependencies` \
120 dart/stable
James E. King, III6e883f92017-11-18 21:18:05 -0500121ENV PATH /usr/lib/dart/bin:$PATH
James E. King, III0ad20bd2017-09-30 15:44:16 -0700122
James E. King, III6e883f92017-11-18 21:18:05 -0500123RUN apt-get install -y --no-install-recommends \
124`# dotnet core dependencies` \
James E. King IIIf338d572018-01-29 14:51:24 -0500125 dotnet-sdk-2.1.4
James E. King, III0ad20bd2017-09-30 15:44:16 -0700126
127RUN apt-get install -y --no-install-recommends \
128`# Erlang dependencies` \
129 erlang-base \
130 erlang-eunit \
131 erlang-dev \
132 erlang-tools \
133 rebar
134
135RUN apt-get install -y --no-install-recommends \
136`# GlibC dependencies` \
137 libglib2.0-dev
138
139RUN apt-get install -y --no-install-recommends \
140`# golang (go) dependencies` \
141 golang-go \
142 golang-race-detector-runtime
143
144RUN apt-get install -y --no-install-recommends \
145`# Haskell dependencies` \
146 ghc \
147 cabal-install
148
149# see THRIFT-4352, test/haxe cores on artful
150# RUN apt-get install -y --no-install-recommends \
151# `# Haxe dependencies` \
152# haxe \
153# neko \
154# neko-dev
155# RUN haxelib setup --always /usr/share/haxe/lib && \
James E. King IIIf64a3fc2018-01-14 08:54:25 -0500156# haxelib install --always hxcpp 2>&1 > /dev/null
James E. King, III0ad20bd2017-09-30 15:44:16 -0700157
158RUN apt-get install -y --no-install-recommends \
159`# Java dependencies` \
160 ant \
161 ant-optional \
162 openjdk-8-jdk \
163 maven
164
165RUN apt-get install -y --no-install-recommends \
166`# Lua dependencies` \
James E. King, III39eaae62017-11-19 20:17:33 -0500167 lua5.2 \
168 lua5.2-dev
James E. King, III0ad20bd2017-09-30 15:44:16 -0700169# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
170# lua5.3 does not install alternatives!
James E. King, III39eaae62017-11-19 20:17:33 -0500171# need to update our luasocket code, lua doesn't have luaL_openlib any more
James E. King, III0ad20bd2017-09-30 15:44:16 -0700172
173RUN apt-get install -y --no-install-recommends \
174`# Node.js dependencies` \
James E. King, III619218c2017-10-29 06:55:00 -0400175 nodejs
James E. King, III0ad20bd2017-09-30 15:44:16 -0700176
177RUN apt-get install -y --no-install-recommends \
178`# OCaml dependencies` \
179 ocaml \
180 opam && \
181 opam init --yes && \
182 opam install --yes oasis
183
184RUN apt-get install -y --no-install-recommends \
185`# Perl dependencies` \
186 libbit-vector-perl \
187 libclass-accessor-class-perl \
188 libcrypt-ssleay-perl \
189 libio-socket-ssl-perl \
190 libnet-ssleay-perl
191
192RUN apt-get install -y --no-install-recommends \
193`# Php dependencies` \
194 php \
195 php-cli \
196 php-dev \
197 php-pear \
198 re2c \
Robert Lua15060a2017-12-28 15:29:39 +0800199 composer
James E. King, III0ad20bd2017-09-30 15:44:16 -0700200
201RUN apt-get install -y --no-install-recommends \
202`# Python dependencies` \
203 python-all \
204 python-all-dbg \
205 python-all-dev \
206 python-ipaddress \
207 python-pip \
208 python-setuptools \
209 python-six \
210 python-tornado \
211 python-twisted \
212 python-wheel \
213 python-zope.interface && \
214 pip install --upgrade backports.ssl_match_hostname
215
216RUN apt-get install -y --no-install-recommends \
217`# Python3 dependencies` \
218 python3-all \
219 python3-all-dbg \
220 python3-all-dev \
221 python3-pip \
222 python3-setuptools \
223 python3-six \
224 python3-tornado \
225 python3-twisted \
226 python3-wheel \
227 python3-zope.interface
228
229RUN apt-get install -y --no-install-recommends \
230`# Ruby dependencies` \
231 ruby \
232 ruby-dev \
233 ruby-bundler
234RUN gem install bundler --no-ri --no-rdoc
235
236RUN apt-get install -y --no-install-recommends \
237`# Rust dependencies` \
238 cargo \
239 rustc
240
241RUN apt-get install -y --no-install-recommends \
242`# Static Code Analysis dependencies` \
243 cppcheck \
244 sloccount && \
245 pip install flake8
246
247# Clean up
248RUN rm -rf /var/cache/apt/* && \
249 rm -rf /var/lib/apt/lists/* && \
250 rm -rf /tmp/* && \
251 rm -rf /var/tmp/*
252
253ENV THRIFT_ROOT /thrift
254RUN mkdir -p $THRIFT_ROOT/src
255COPY Dockerfile $THRIFT_ROOT/
256WORKDIR $THRIFT_ROOT/src