blob: c640bd93136e70fb5132ffbf1dbe780b472c5400 [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
James E. King, III0ad20bd2017-09-30 15:44:16 -070030RUN apt-get update && apt-get dist-upgrade -y && apt-get install -y --no-install-recommends apt apt-transport-https curl wget apt-utils
James E. King, IIIb66b66f2017-08-31 18:07:40 -070031
James E. King, IIIf4543692017-09-01 05:23:29 -070032# csharp (mono)
James E. King, III0ad20bd2017-09-30 15:44:16 -070033# RUN echo "deb http://download.mono-project.com/repo/debian xenial main" | tee /etc/apt/sources.list.d/mono.list && \
34# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A6A19B38D3D831EF
James E. King, IIIb66b66f2017-08-31 18:07:40 -070035
36# D
37RUN 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 -070038 wget -qO - https://dlang.org/d-keyring.gpg | apt-key add -
39ENV D_VERSION 2.073.2-0
James E. King, IIIb66b66f2017-08-31 18:07:40 -070040
41# Dart
42RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
43 curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list && \
44 sed -i /etc/apt/sources.list.d/dart_stable.list -e 's/https:/http:/g'
James E. King, III0ad20bd2017-09-30 15:44:16 -070045# since ubuntu-artful can't run dart, we'll run 1.240 on xenial for now
46ENV DART_VERSION 1.24.2-1
James E. King, IIIb66b66f2017-08-31 18:07:40 -070047
James E. King, III6e883f92017-11-18 21:18:05 -050048# dotnet (core)
James E. King, IIIb6287362017-09-28 11:57:42 +000049RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \
50 echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > /etc/apt/sources.list.d/dotnetdev.list
James E. King, IIIb66b66f2017-08-31 18:07:40 -070051
52# node.js (this step runs apt-get update internally)
James E. King, III699b5bc2017-09-14 08:07:08 -070053# note: node 8.5 introduced some issues with directory handling / jsdoc / something... using 7.x for now
James E. King, III0ad20bd2017-09-30 15:44:16 -070054# RUN curl -sL https://deb.nodesource.com/setup_7.x | bash
James E. King, IIIb66b66f2017-08-31 18:07:40 -070055
James E. King, IIId7142b72017-09-01 13:00:36 -070056
57### install general dependencies
James E. King, III0ad20bd2017-09-30 15:44:16 -070058RUN apt-get update && apt-get install -y --no-install-recommends \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070059`# General dependencies` \
James E. King, IIIf4543692017-09-01 05:23:29 -070060 bash-completion \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070061 bison \
62 build-essential \
63 clang \
64 cmake \
65 debhelper \
66 flex \
James E. King, IIId7142b72017-09-01 13:00:36 -070067 gdb \
68 llvm \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070069 ninja-build \
70 pkg-config \
James E. King, III7d211b82017-09-06 10:12:02 -070071 valgrind \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070072 vim
James E. King, IIId7142b72017-09-01 13:00:36 -070073ENV PATH /usr/lib/llvm-3.8/bin:$PATH
James E. King, IIIb66b66f2017-08-31 18:07:40 -070074
James E. King, IIId7142b72017-09-01 13:00:36 -070075### languages
James E. King, IIIb66b66f2017-08-31 18:07:40 -070076
77RUN apt-get install -y --no-install-recommends \
78`# C++ dependencies` \
79 libboost-dev \
80 libboost-filesystem-dev \
81 libboost-program-options-dev \
82 libboost-system-dev \
83 libboost-test-dev \
84 libboost-thread-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 \
James E. King, IIIf4543692017-09-01 05:23:29 -070092`# csharp (mono) dependencies` \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070093 mono-devel
94
James E. King, III0ad20bd2017-09-30 15:44:16 -070095RUN apt-get install -y --allow-unauthenticated --no-install-recommends \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070096`# D dependencies` \
James E. King, III0ad20bd2017-09-30 15:44:16 -070097 dmd-bin=$D_VERSION \
98 libphobos2-dev=$D_VERSION \
99 dub \
100 dfmt \
101 dscanner \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700102 libevent-dev \
103 libssl-dev \
104 xdg-utils
James E. King, III0ad20bd2017-09-30 15:44:16 -0700105# libevent deimos doesn't seem to work so not enabling it:
James E. King, IIId7142b72017-09-01 13:00:36 -0700106# RUN mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
107# curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
108# mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
109# mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \
110# rm -rf libevent-master
James E. King, III0ad20bd2017-09-30 15:44:16 -0700111# openssl deimos doesn't work with openssl-1.0.2 so not enabling it:
James E. King, IIId7142b72017-09-01 13:00:36 -0700112# RUN curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
113# mv openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
114# mv openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
115# rm -rf openssl-master
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700116
117RUN apt-get install -y --no-install-recommends \
118`# Dart dependencies` \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700119 dart=$DART_VERSION
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700120ENV PATH /usr/lib/dart/bin:$PATH
121
James E. King, IIIb6287362017-09-28 11:57:42 +0000122RUN apt-get install -y --no-install-recommends \
123`# dotnet core dependencies` \
James E. King, III6e883f92017-11-18 21:18:05 -0500124 dotnet-sdk-2.0.3
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700125
126RUN apt-get install -y --no-install-recommends \
127`# Erlang dependencies` \
128 erlang-base \
129 erlang-eunit \
130 erlang-dev \
131 erlang-tools \
132 rebar
133
134RUN apt-get install -y --no-install-recommends \
135`# GlibC dependencies` \
136 libglib2.0-dev
137
138RUN apt-get install -y --no-install-recommends \
139`# golang (go) dependencies` \
James E. King, IIIf4543692017-09-01 05:23:29 -0700140 golang-go \
141 golang-race-detector-runtime
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700142
143RUN apt-get install -y --no-install-recommends \
144`# Haskell dependencies` \
145 ghc \
146 cabal-install
147
148RUN apt-get install -y --no-install-recommends \
149`# Haxe dependencies` \
150 haxe \
151 neko \
152 neko-dev \
153 libneko0
James E. King, IIId7142b72017-09-01 13:00:36 -0700154RUN haxelib setup --always /usr/share/haxe/lib && \
James E. King, III81cdcd32017-09-09 17:54:10 +0000155 haxelib install --always hxcpp 3.4.64
156# 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 -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, IIId7142b72017-09-01 13:00:36 -0700167 lua5.2 \
168 lua5.2-dev
169# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
170# lua5.3 does not install alternatives so stick with 5.2 here
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700171
172RUN apt-get install -y --no-install-recommends \
173`# Node.js dependencies` \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700174 nodejs \
175 npm && \
176 ln -s /usr/bin/nodejs /usr/bin/node
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700177
178RUN apt-get install -y --no-install-recommends \
179`# OCaml dependencies` \
James E. King, IIId7142b72017-09-01 13:00:36 -0700180 ocaml \
181 opam && \
182 opam init --yes && \
183 opam install --yes oasis
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700184
185RUN apt-get install -y --no-install-recommends \
186`# Perl dependencies` \
187 libbit-vector-perl \
188 libclass-accessor-class-perl \
189 libcrypt-ssleay-perl \
190 libio-socket-ssl-perl \
191 libnet-ssleay-perl
192
193RUN apt-get install -y --no-install-recommends \
194`# Php dependencies` \
195 php7.0 \
196 php7.0-cli \
197 php7.0-dev \
198 php-pear \
199 re2c \
200 phpunit
201
202RUN apt-get install -y --no-install-recommends \
203`# Python dependencies` \
204 python-all \
205 python-all-dbg \
206 python-all-dev \
207 python-backports.ssl-match-hostname \
208 python-ipaddress \
209 python-pip \
210 python-setuptools \
James E. King, IIId7142b72017-09-01 13:00:36 -0700211 python-six \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700212 python-tornado \
213 python-twisted \
James E. King, IIId7142b72017-09-01 13:00:36 -0700214 python-wheel \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700215 python-zope.interface \
216 python3-all \
217 python3-all-dbg \
218 python3-all-dev \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700219 python3-setuptools \
James E. King, IIId7142b72017-09-01 13:00:36 -0700220 python3-six \
221 python3-tornado \
222 python3-twisted \
223 python3-wheel \
224 python3-zope.interface && \
225 pip install --upgrade backports.ssl_match_hostname
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700226
227RUN apt-get install -y --no-install-recommends \
228`# Ruby dependencies` \
229 ruby \
230 ruby-dev \
231 ruby-bundler
232RUN gem install bundler --no-ri --no-rdoc
233
234RUN apt-get install -y --no-install-recommends \
235`# Rust dependencies` \
236 cargo \
237 rustc
238
James E. King, IIId7142b72017-09-01 13:00:36 -0700239# Clean up
240RUN rm -rf /var/cache/apt/* && \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700241 rm -rf /var/lib/apt/lists/* && \
242 rm -rf /tmp/* && \
243 rm -rf /var/tmp/*
244
James E. King, IIIb6287362017-09-28 11:57:42 +0000245ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700246ENV THRIFT_ROOT /thrift
247RUN mkdir -p $THRIFT_ROOT/src
248COPY Dockerfile $THRIFT_ROOT/
249WORKDIR $THRIFT_ROOT/src