blob: d8e7e12f1f057bbe1c2f86db4bc583e80ba11bc5 [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# D
45RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EBCF975E5BA24D5E && \
46 wget http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list && \
47 wget -qO - https://dlang.org/d-keyring.gpg | apt-key add -
48
49# Dart
50RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
51 curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > \
52 /etc/apt/sources.list.d/dart_stable.list
James E. King, III0ad20bd2017-09-30 15:44:16 -070053
James E. King IIId907cc92018-01-12 10:43:25 -050054# dotnet (netcore)
55RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \
56 echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-artful-prod artful main" > \
57 /etc/apt/sources.list.d/dotnetdev.list
58
59# haxe (https://haxe.org/download/linux/)
60RUN add-apt-repository ppa:haxe/releases -y
61
62# node.js
63RUN curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
64 echo "deb https://deb.nodesource.com/node_8.x artful main" | tee /etc/apt/sources.list.d/nodesource.list
65
James E. King, III0ad20bd2017-09-30 15:44:16 -070066### install general dependencies
Robert Lu31d5b7b2018-01-05 13:44:38 +080067RUN apt-get update && apt-get install -y --no-install-recommends \
James E. King, III0ad20bd2017-09-30 15:44:16 -070068`# General dependencies` \
69 bash-completion \
70 bison \
71 build-essential \
72 clang \
73 cmake \
74 debhelper \
75 flex \
76 gdb \
77 llvm \
78 ninja-build \
79 pkg-config \
80 valgrind \
81 vim
82ENV PATH /usr/lib/llvm-3.8/bin:$PATH
83
84# boost-1.62 has a terrible bug in boost::test, see https://svn.boost.org/trac10/ticket/12507
85RUN apt-get install -y --no-install-recommends \
86`# C++ dependencies` \
87 libboost1.63-all-dev \
88 libevent-dev \
89 libssl-dev \
90 qt5-default \
91 qtbase5-dev \
92 qtbase5-dev-tools
93
94RUN apt-get install -y --no-install-recommends \
95`# csharp (mono) dependencies` \
96 mono-devel
97
James E. King IIIf338d572018-01-29 14:51:24 -050098ENV D_VERSION 2.077.1-0.1
Robert Lu31d5b7b2018-01-05 13:44:38 +080099RUN apt-get install -y --no-install-recommends \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700100 `# D dependencies` \
James E. King IIIf338d572018-01-29 14:51:24 -0500101 dmd-bin=$D_VERSION \
102 libphobos2-dev=$D_VERSION \
103 dmd-compiler=$D_VERSION \
104 dmd-tools=$D_VERSION \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700105 dub \
106 dfmt \
107 dscanner \
108 libevent-dev \
109 libssl-dev \
110 xdg-utils
James E. King IIIf338d572018-01-29 14:51:24 -0500111RUN 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
116RUN curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
117 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