blob: 153ce61e0c53a14c89497dc3fe21abaa139869f8 [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
Aki Sukegawab03d7492018-06-08 11:39:34 +090021# - go: artful comes with 1.9, we want the latest (supported)
22# - nodejs: want v8, artful comes with v6
James E. King IIIa37feaf2018-03-06 15:11:01 -050023#
James E. King, III0ad20bd2017-09-30 15:44:16 -070024
25FROM buildpack-deps:artful-scm
26MAINTAINER Apache Thrift <dev@thrift.apache.org>
27ENV DEBIAN_FRONTEND noninteractive
28
Robert Lu31d5b7b2018-01-05 13:44:38 +080029### Add apt repos
30
Robert Lua15060a2017-12-28 15:29:39 +080031RUN apt-get update && \
32 apt-get dist-upgrade -y && \
James E. King, III0ad20bd2017-09-30 15:44:16 -070033 apt-get install -y --no-install-recommends \
34 apt \
35 apt-transport-https \
36 apt-utils \
37 curl \
38 dirmngr \
39 software-properties-common \
40 wget
41
42# csharp (mono) - if we ever want a later version
43# RUN echo "deb http://download.mono-project.com/repo/debian xenial main" | tee /etc/apt/sources.list.d/mono.list && \
44# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A6A19B38D3D831EF
45
Robert Lu31d5b7b2018-01-05 13:44:38 +080046# Dart
47RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
48 curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > \
49 /etc/apt/sources.list.d/dart_stable.list
James E. King, III0ad20bd2017-09-30 15:44:16 -070050
James E. King IIId907cc92018-01-12 10:43:25 -050051# dotnet (netcore)
52RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \
53 echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-artful-prod artful main" > \
54 /etc/apt/sources.list.d/dotnetdev.list
55
56# haxe (https://haxe.org/download/linux/)
57RUN add-apt-repository ppa:haxe/releases -y
58
59# node.js
James E. King III78755f52018-03-06 09:50:33 -050060RUN curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
James E. King IIId907cc92018-01-12 10:43:25 -050061 echo "deb https://deb.nodesource.com/node_8.x artful main" | tee /etc/apt/sources.list.d/nodesource.list
62
James E. King, III0ad20bd2017-09-30 15:44:16 -070063### 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 III859a40c2018-03-19 08:16:51 -040095ENV SBCL_VERSION 1.4.5
James E. King IIIbf7f76b2018-02-28 17:11:05 -050096RUN \
Tomek Kurcze93a9012017-09-19 09:16:43 +020097`# Common Lisp (sbcl) dependencies` \
James E. King IIIbf7f76b2018-02-28 17:11:05 -050098 curl --version && \
99 curl -O -J -L https://kent.dl.sourceforge.net/project/sbcl/sbcl/${SBCL_VERSION}/sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2 && \
100 tar xjf sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2 && \
101 cd sbcl-${SBCL_VERSION}-x86-64-linux && \
102 ./install.sh && \
103 sbcl --version && \
104 rm -rf sbcl*
Tomek Kurcze93a9012017-09-19 09:16:43 +0200105
Aki Sukegawab03d7492018-06-08 11:39:34 +0900106ENV D_VERSION 2.080.0
107ENV DMD_DEB dmd_2.080.0-0_amd64.deb
James E. King IIIbf7f76b2018-02-28 17:11:05 -0500108RUN \
109`# D dependencies` \
110 wget -q http://downloads.dlang.org/releases/2.x/${D_VERSION}/${DMD_DEB} && \
111 dpkg --install ${DMD_DEB} && \
112 rm -f ${DMD_DEB} && \
113 mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
James E. King IIIf338d572018-01-29 14:51:24 -0500114 curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
115 mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
116 mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \
James E. King IIIbf7f76b2018-02-28 17:11:05 -0500117 rm -rf libevent-master && \
118 curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
James E. King IIIf338d572018-01-29 14:51:24 -0500119 mv openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
120 mv openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
121 rm -rf openssl-master
James E. King, III0ad20bd2017-09-30 15:44:16 -0700122
Robert Lu31d5b7b2018-01-05 13:44:38 +0800123RUN apt-get install -y --no-install-recommends \
Robert Luc72d8dc2017-12-29 04:14:38 +0800124 `# Dart dependencies` \
125 dart/stable
James E. King, III6e883f92017-11-18 21:18:05 -0500126ENV PATH /usr/lib/dart/bin:$PATH
James E. King, III0ad20bd2017-09-30 15:44:16 -0700127
James E. King, III6e883f92017-11-18 21:18:05 -0500128RUN apt-get install -y --no-install-recommends \
129`# dotnet core dependencies` \
James E. King IIIf338d572018-01-29 14:51:24 -0500130 dotnet-sdk-2.1.4
James E. King, III0ad20bd2017-09-30 15:44:16 -0700131
132RUN apt-get install -y --no-install-recommends \
133`# Erlang dependencies` \
134 erlang-base \
135 erlang-eunit \
136 erlang-dev \
137 erlang-tools \
138 rebar
139
140RUN apt-get install -y --no-install-recommends \
141`# GlibC dependencies` \
142 libglib2.0-dev
143
John Boiles57852792018-01-05 14:37:05 -0800144# golang
D. Can Celasuna9efd1a2018-03-15 12:52:37 +0100145ENV GOLANG_VERSION 1.10
John Boiles57852792018-01-05 14:37:05 -0800146ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
D. Can Celasuna9efd1a2018-03-15 12:52:37 +0100147ENV GOLANG_DOWNLOAD_SHA256 b5a64335f1490277b585832d1f6c7f8c6c11206cba5cd3f771dcb87b98ad1a33
John Boiles57852792018-01-05 14:37:05 -0800148RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \
149 echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \
150 tar -C /usr/local -xzf golang.tar.gz && \
151 ln -s /usr/local/go/bin/go /usr/local/bin && \
152 rm golang.tar.gz
James E. King, III0ad20bd2017-09-30 15:44:16 -0700153
154RUN apt-get install -y --no-install-recommends \
155`# Haskell dependencies` \
156 ghc \
157 cabal-install
158
James E. King IIId907cc92018-01-12 10:43:25 -0500159RUN apt-get install -y --no-install-recommends \
160`# Haxe dependencies` \
161 haxe \
162 neko \
163 neko-dev && \
164 haxelib setup --always /usr/share/haxe/lib && \
165 haxelib install --always hxcpp 2>&1 > /dev/null
James E. King, III0ad20bd2017-09-30 15:44:16 -0700166
167RUN apt-get install -y --no-install-recommends \
168`# Java dependencies` \
169 ant \
170 ant-optional \
171 openjdk-8-jdk \
172 maven
173
174RUN apt-get install -y --no-install-recommends \
175`# Lua dependencies` \
James E. King, III39eaae62017-11-19 20:17:33 -0500176 lua5.2 \
177 lua5.2-dev
James E. King, III0ad20bd2017-09-30 15:44:16 -0700178# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
179# lua5.3 does not install alternatives!
James E. King, III39eaae62017-11-19 20:17:33 -0500180# need to update our luasocket code, lua doesn't have luaL_openlib any more
James E. King, III0ad20bd2017-09-30 15:44:16 -0700181
182RUN apt-get install -y --no-install-recommends \
183`# Node.js dependencies` \
James E. King, III619218c2017-10-29 06:55:00 -0400184 nodejs
James E. King, III0ad20bd2017-09-30 15:44:16 -0700185
186RUN apt-get install -y --no-install-recommends \
187`# OCaml dependencies` \
188 ocaml \
189 opam && \
190 opam init --yes && \
191 opam install --yes oasis
192
193RUN apt-get install -y --no-install-recommends \
194`# Perl dependencies` \
195 libbit-vector-perl \
196 libclass-accessor-class-perl \
197 libcrypt-ssleay-perl \
198 libio-socket-ssl-perl \
199 libnet-ssleay-perl
200
201RUN apt-get install -y --no-install-recommends \
202`# Php dependencies` \
203 php \
204 php-cli \
205 php-dev \
206 php-pear \
207 re2c \
Robert Lua15060a2017-12-28 15:29:39 +0800208 composer
James E. King, III0ad20bd2017-09-30 15:44:16 -0700209
210RUN apt-get install -y --no-install-recommends \
211`# Python dependencies` \
212 python-all \
213 python-all-dbg \
214 python-all-dev \
215 python-ipaddress \
216 python-pip \
217 python-setuptools \
218 python-six \
219 python-tornado \
220 python-twisted \
221 python-wheel \
222 python-zope.interface && \
223 pip install --upgrade backports.ssl_match_hostname
224
225RUN apt-get install -y --no-install-recommends \
226`# Python3 dependencies` \
227 python3-all \
228 python3-all-dbg \
229 python3-all-dev \
230 python3-pip \
231 python3-setuptools \
232 python3-six \
233 python3-tornado \
234 python3-twisted \
235 python3-wheel \
236 python3-zope.interface
237
238RUN apt-get install -y --no-install-recommends \
239`# Ruby dependencies` \
240 ruby \
241 ruby-dev \
242 ruby-bundler
James E. King, III0ad20bd2017-09-30 15:44:16 -0700243
244RUN apt-get install -y --no-install-recommends \
245`# Rust dependencies` \
246 cargo \
247 rustc
248
249RUN apt-get install -y --no-install-recommends \
250`# Static Code Analysis dependencies` \
251 cppcheck \
252 sloccount && \
253 pip install flake8
254
255# Clean up
256RUN rm -rf /var/cache/apt/* && \
257 rm -rf /var/lib/apt/lists/* && \
258 rm -rf /tmp/* && \
259 rm -rf /var/tmp/*
260
261ENV THRIFT_ROOT /thrift
262RUN mkdir -p $THRIFT_ROOT/src
263COPY Dockerfile $THRIFT_ROOT/
264WORKDIR $THRIFT_ROOT/src