blob: b37434bb7dc3bdd5014fc134789586f928766d82 [file] [log] [blame]
James E. King, IIIb66b66f2017-08-31 18:07:40 -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
James E. King, III0ad20bd2017-09-30 15:44:16 -070013#
James E. King, IIIb66b66f2017-08-31 18:07:40 -070014# Apache Thrift Docker build environment for Ubuntu Xenial
James E. King, III0ad20bd2017-09-30 15:44:16 -070015# Using all stock Ubuntu Xenial packaging except for:
16# - d: does not come with Ubuntu so we're installing 2.073.2 for coverage
17# - dart: does not come with Ubuntu so we're installing 1.22.1 for coverage
18#
19
James E. King, IIId7142b72017-09-01 13:00:36 -070020#
21# Known missing or disabled libraries:
22# - d: deimos for libevent and openssl omitted - not compatible / build errors
James E. King, IIIb66b66f2017-08-31 18:07:40 -070023
24FROM buildpack-deps:xenial-scm
25MAINTAINER Apache Thrift <dev@thrift.apache.org>
James E. King, IIIb66b66f2017-08-31 18:07:40 -070026ENV DEBIAN_FRONTEND noninteractive
27
James E. King, IIId7142b72017-09-01 13:00:36 -070028### Add apt repos
James E. King, IIIb66b66f2017-08-31 18:07:40 -070029
Robert Lu31d5b7b2018-01-05 13:44:38 +080030RUN apt-get update && \
31 apt-get dist-upgrade -y && \
32 apt-get install -y --no-install-recommends \
33 apt \
34 apt-transport-https \
35 apt-utils \
36 curl \
James E. King IIIad238522018-01-13 19:52:31 -050037 software-properties-common \
Robert Lu31d5b7b2018-01-05 13:44:38 +080038 wget
James E. King, IIIb66b66f2017-08-31 18:07:40 -070039
James E. King, IIIf4543692017-09-01 05:23:29 -070040# csharp (mono)
James E. King, III0ad20bd2017-09-30 15:44:16 -070041# 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
James E. King, IIIb66b66f2017-08-31 18:07:40 -070043
44# D
James E. King IIIad238522018-01-13 19:52:31 -050045RUN 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 && \
James E. King, III0ad20bd2017-09-30 15:44:16 -070047 wget -qO - https://dlang.org/d-keyring.gpg | apt-key add -
48ENV D_VERSION 2.073.2-0
James E. King, IIIb66b66f2017-08-31 18:07:40 -070049
50# Dart
51RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
Robert Lu31d5b7b2018-01-05 13:44:38 +080052 curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > \
53 /etc/apt/sources.list.d/dart_stable.list
James E. King IIIad238522018-01-13 19:52:31 -050054ENV DART_VERSION 1.22.1-1
James E. King, IIIb66b66f2017-08-31 18:07:40 -070055
James E. King, III6e883f92017-11-18 21:18:05 -050056# dotnet (core)
James E. King, IIIb6287362017-09-28 11:57:42 +000057RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \
Robert Lu31d5b7b2018-01-05 13:44:38 +080058 echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > \
59 /etc/apt/sources.list.d/dotnetdev.list
James E. King, IIId7142b72017-09-01 13:00:36 -070060
61### install general dependencies
James E. King, III0ad20bd2017-09-30 15:44:16 -070062RUN apt-get update && apt-get install -y --no-install-recommends \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070063`# General dependencies` \
James E. King, IIIf4543692017-09-01 05:23:29 -070064 bash-completion \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070065 bison \
66 build-essential \
67 clang \
68 cmake \
69 debhelper \
70 flex \
James E. King, IIId7142b72017-09-01 13:00:36 -070071 gdb \
72 llvm \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070073 ninja-build \
74 pkg-config \
James E. King, III7d211b82017-09-06 10:12:02 -070075 valgrind \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070076 vim
James E. King, IIId7142b72017-09-01 13:00:36 -070077ENV PATH /usr/lib/llvm-3.8/bin:$PATH
James E. King, IIIb66b66f2017-08-31 18:07:40 -070078
James E. King, IIId7142b72017-09-01 13:00:36 -070079### languages
James E. King, IIIb66b66f2017-08-31 18:07:40 -070080
81RUN apt-get install -y --no-install-recommends \
82`# C++ dependencies` \
83 libboost-dev \
84 libboost-filesystem-dev \
85 libboost-program-options-dev \
86 libboost-system-dev \
87 libboost-test-dev \
88 libboost-thread-dev \
89 libevent-dev \
90 libssl-dev \
91 qt5-default \
92 qtbase5-dev \
93 qtbase5-dev-tools
94
95RUN apt-get install -y --no-install-recommends \
James E. King, IIIf4543692017-09-01 05:23:29 -070096`# csharp (mono) dependencies` \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070097 mono-devel
98
James E. King, III0ad20bd2017-09-30 15:44:16 -070099RUN apt-get install -y --allow-unauthenticated --no-install-recommends \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700100`# D dependencies` \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700101 dmd-bin=$D_VERSION \
102 libphobos2-dev=$D_VERSION \
103 dub \
104 dfmt \
105 dscanner \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700106 libevent-dev \
107 libssl-dev \
108 xdg-utils
James E. King IIIf338d572018-01-29 14:51:24 -0500109RUN mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
110 curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
111 mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
112 mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \
113 rm -rf libevent-master
114RUN curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
115 mv openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
116 mv openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
117 rm -rf openssl-master
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700118
119RUN apt-get install -y --no-install-recommends \
120`# Dart dependencies` \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700121 dart=$DART_VERSION
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700122ENV PATH /usr/lib/dart/bin:$PATH
123
James E. King, IIIb6287362017-09-28 11:57:42 +0000124RUN apt-get install -y --no-install-recommends \
125`# dotnet core dependencies` \
James E. King IIIf338d572018-01-29 14:51:24 -0500126 dotnet-sdk-2.1.4
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700127
128RUN apt-get install -y --no-install-recommends \
129`# Erlang dependencies` \
130 erlang-base \
131 erlang-eunit \
132 erlang-dev \
133 erlang-tools \
134 rebar
135
136RUN apt-get install -y --no-install-recommends \
137`# GlibC dependencies` \
138 libglib2.0-dev
139
140RUN apt-get install -y --no-install-recommends \
141`# golang (go) dependencies` \
James E. King, IIIf4543692017-09-01 05:23:29 -0700142 golang-go \
143 golang-race-detector-runtime
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700144
145RUN apt-get install -y --no-install-recommends \
146`# Haskell dependencies` \
147 ghc \
148 cabal-install
149
150RUN apt-get install -y --no-install-recommends \
151`# Haxe dependencies` \
152 haxe \
153 neko \
154 neko-dev \
James E. King IIIad238522018-01-13 19:52:31 -0500155 libneko0 && \
156 haxelib setup --always /usr/share/haxe/lib && \
James E. King IIIf64a3fc2018-01-14 08:54:25 -0500157 haxelib install --always hxcpp 3.4.64 2>&1 > /dev/null
James E. King, III81cdcd32017-09-09 17:54:10 +0000158# note: hxcpp 3.4.185 (latest) no longer ships static libraries, and caused a build failure
James E. King, IIIb66b66f2017-08-31 18:07:40 -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, IIId7142b72017-09-01 13:00:36 -0700169 lua5.2 \
170 lua5.2-dev
171# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
172# lua5.3 does not install alternatives so stick with 5.2 here
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700173
174RUN apt-get install -y --no-install-recommends \
175`# Node.js dependencies` \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700176 nodejs \
177 npm && \
178 ln -s /usr/bin/nodejs /usr/bin/node
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700179
180RUN apt-get install -y --no-install-recommends \
181`# OCaml dependencies` \
James E. King, IIId7142b72017-09-01 13:00:36 -0700182 ocaml \
183 opam && \
184 opam init --yes && \
185 opam install --yes oasis
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700186
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 php7.0 \
198 php7.0-cli \
199 php7.0-dev \
200 php-pear \
201 re2c \
Robert Lua15060a2017-12-28 15:29:39 +0800202 composer
James E. King, IIIb66b66f2017-08-31 18:07:40 -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-backports.ssl-match-hostname \
210 python-ipaddress \
211 python-pip \
212 python-setuptools \
James E. King, IIId7142b72017-09-01 13:00:36 -0700213 python-six \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700214 python-tornado \
215 python-twisted \
James E. King, IIId7142b72017-09-01 13:00:36 -0700216 python-wheel \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700217 python-zope.interface \
218 python3-all \
219 python3-all-dbg \
220 python3-all-dev \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700221 python3-setuptools \
James E. King, IIId7142b72017-09-01 13:00:36 -0700222 python3-six \
223 python3-tornado \
224 python3-twisted \
225 python3-wheel \
226 python3-zope.interface && \
227 pip install --upgrade backports.ssl_match_hostname
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700228
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
James E. King, IIId7142b72017-09-01 13:00:36 -0700241# Clean up
242RUN rm -rf /var/cache/apt/* && \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700243 rm -rf /var/lib/apt/lists/* && \
244 rm -rf /tmp/* && \
245 rm -rf /var/tmp/*
246
James E. King, IIIb6287362017-09-28 11:57:42 +0000247ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700248ENV THRIFT_ROOT /thrift
249RUN mkdir -p $THRIFT_ROOT/src
250COPY Dockerfile $THRIFT_ROOT/
251WORKDIR $THRIFT_ROOT/src