blob: 61ba5ffc3f7d2b1a11eabb58e115f0a7cb730198 [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
13# Apache Thrift Docker build environment for Ubuntu Xenial
James E. King, IIId7142b72017-09-01 13:00:36 -070014#
15# Known missing or disabled libraries:
16# - d: deimos for libevent and openssl omitted - not compatible / build errors
17# - dotnetcore, because netcore is for 1.0.0-preview and 2.0.0 is out
James E. King, IIIb66b66f2017-08-31 18:07:40 -070018
19FROM buildpack-deps:xenial-scm
20MAINTAINER Apache Thrift <dev@thrift.apache.org>
21
22ENV DEBIAN_FRONTEND noninteractive
23
James E. King, IIId7142b72017-09-01 13:00:36 -070024### Add apt repos
James E. King, IIIb66b66f2017-08-31 18:07:40 -070025
26RUN apt-get update && apt-get install -y --no-install-recommends apt apt-transport-https curl wget apt-utils
27
James E. King, IIIf4543692017-09-01 05:23:29 -070028# csharp (mono)
James E. King, IIIb66b66f2017-08-31 18:07:40 -070029RUN echo "deb http://download.mono-project.com/repo/debian xenial main" | tee /etc/apt/sources.list.d/mono.list && \
30 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A6A19B38D3D831EF
31
32# D
33RUN wget http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list && \
34 apt-get update && apt-get -y --allow-unauthenticated install --reinstall d-apt-keyring
35
36# Dart
37RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
38 curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list && \
39 sed -i /etc/apt/sources.list.d/dart_stable.list -e 's/https:/http:/g'
40
James E. King, IIId7142b72017-09-01 13:00:36 -070041# dotnet (core) 2.0.0 - project isn't ready for this yet:
42# RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \
43# 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 -070044
45# node.js (this step runs apt-get update internally)
46RUN curl -sL https://deb.nodesource.com/setup_8.x | bash
47
James E. King, IIId7142b72017-09-01 13:00:36 -070048
49### install general dependencies
James E. King, IIIb66b66f2017-08-31 18:07:40 -070050RUN apt-get install -y --no-install-recommends \
51`# General dependencies` \
James E. King, IIIf4543692017-09-01 05:23:29 -070052 bash-completion \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070053 bison \
54 build-essential \
55 clang \
56 cmake \
57 debhelper \
58 flex \
James E. King, IIId7142b72017-09-01 13:00:36 -070059 gdb \
60 llvm \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070061 ninja-build \
62 pkg-config \
James E. King, III7d211b82017-09-06 10:12:02 -070063 valgrind \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070064 vim
James E. King, IIId7142b72017-09-01 13:00:36 -070065ENV PATH /usr/lib/llvm-3.8/bin:$PATH
James E. King, IIIb66b66f2017-08-31 18:07:40 -070066
James E. King, IIId7142b72017-09-01 13:00:36 -070067### languages
James E. King, IIIb66b66f2017-08-31 18:07:40 -070068
69RUN apt-get install -y --no-install-recommends \
70`# C++ dependencies` \
71 libboost-dev \
72 libboost-filesystem-dev \
73 libboost-program-options-dev \
74 libboost-system-dev \
75 libboost-test-dev \
76 libboost-thread-dev \
77 libevent-dev \
78 libssl-dev \
79 qt5-default \
80 qtbase5-dev \
81 qtbase5-dev-tools
82
83RUN apt-get install -y --no-install-recommends \
James E. King, IIIf4543692017-09-01 05:23:29 -070084`# csharp (mono) dependencies` \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070085 mono-devel
86
87RUN apt-get install -y --no-install-recommends \
88`# D dependencies` \
89 dmd-bin \
90 libevent-dev \
91 libssl-dev \
92 xdg-utils
James E. King, IIId7142b72017-09-01 13:00:36 -070093# libevent deimos doesn't seem to work so disabling it:
94# RUN mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
95# curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
96# mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
97# mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \
98# rm -rf libevent-master
99# openssl deimos doesn't work with openssl-1.0.2 so disabling it:
100# RUN curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
101# mv openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
102# mv openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
103# rm -rf openssl-master
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700104
105RUN apt-get install -y --no-install-recommends \
106`# Dart dependencies` \
107 dart
108ENV PATH /usr/lib/dart/bin:$PATH
109
James E. King, IIId7142b72017-09-01 13:00:36 -0700110# project isn't ready for this quite yet:
111# RUN apt-get install -y --no-install-recommends \
112# `# dotnet core dependencies` \
113# dotnet-sdk-2.0.0
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700114
115RUN apt-get install -y --no-install-recommends \
116`# Erlang dependencies` \
117 erlang-base \
118 erlang-eunit \
119 erlang-dev \
120 erlang-tools \
121 rebar
122
123RUN apt-get install -y --no-install-recommends \
124`# GlibC dependencies` \
125 libglib2.0-dev
126
127RUN apt-get install -y --no-install-recommends \
128`# golang (go) dependencies` \
James E. King, IIIf4543692017-09-01 05:23:29 -0700129 golang-go \
130 golang-race-detector-runtime
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700131
132RUN apt-get install -y --no-install-recommends \
133`# Haskell dependencies` \
134 ghc \
135 cabal-install
136
137RUN apt-get install -y --no-install-recommends \
138`# Haxe dependencies` \
139 haxe \
140 neko \
141 neko-dev \
142 libneko0
James E. King, IIId7142b72017-09-01 13:00:36 -0700143RUN haxelib setup --always /usr/share/haxe/lib && \
James E. King, III81cdcd32017-09-09 17:54:10 +0000144 haxelib install --always hxcpp 3.4.64
145# 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 -0700146
147RUN apt-get install -y --no-install-recommends \
148`# Java dependencies` \
149 ant \
150 ant-optional \
151 openjdk-8-jdk \
152 maven
153
154RUN apt-get install -y --no-install-recommends \
155`# Lua dependencies` \
James E. King, IIId7142b72017-09-01 13:00:36 -0700156 lua5.2 \
157 lua5.2-dev
158# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
159# lua5.3 does not install alternatives so stick with 5.2 here
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700160
161RUN apt-get install -y --no-install-recommends \
162`# Node.js dependencies` \
163 nodejs
164
165RUN apt-get install -y --no-install-recommends \
166`# OCaml dependencies` \
James E. King, IIId7142b72017-09-01 13:00:36 -0700167 ocaml \
168 opam && \
169 opam init --yes && \
170 opam install --yes oasis
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700171
172RUN apt-get install -y --no-install-recommends \
173`# Perl dependencies` \
174 libbit-vector-perl \
175 libclass-accessor-class-perl \
176 libcrypt-ssleay-perl \
177 libio-socket-ssl-perl \
178 libnet-ssleay-perl
179
180RUN apt-get install -y --no-install-recommends \
181`# Php dependencies` \
182 php7.0 \
183 php7.0-cli \
184 php7.0-dev \
185 php-pear \
186 re2c \
187 phpunit
188
189RUN apt-get install -y --no-install-recommends \
190`# Python dependencies` \
191 python-all \
192 python-all-dbg \
193 python-all-dev \
194 python-backports.ssl-match-hostname \
195 python-ipaddress \
196 python-pip \
197 python-setuptools \
James E. King, IIId7142b72017-09-01 13:00:36 -0700198 python-six \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700199 python-tornado \
200 python-twisted \
James E. King, IIId7142b72017-09-01 13:00:36 -0700201 python-wheel \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700202 python-zope.interface \
203 python3-all \
204 python3-all-dbg \
205 python3-all-dev \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700206 python3-setuptools \
James E. King, IIId7142b72017-09-01 13:00:36 -0700207 python3-six \
208 python3-tornado \
209 python3-twisted \
210 python3-wheel \
211 python3-zope.interface && \
212 pip install --upgrade backports.ssl_match_hostname
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700213
214RUN apt-get install -y --no-install-recommends \
215`# Ruby dependencies` \
216 ruby \
217 ruby-dev \
218 ruby-bundler
219RUN gem install bundler --no-ri --no-rdoc
220
221RUN apt-get install -y --no-install-recommends \
222`# Rust dependencies` \
223 cargo \
224 rustc
225
James E. King, IIId7142b72017-09-01 13:00:36 -0700226# Update anything else left hanging
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700227RUN apt-get dist-upgrade -y
228
James E. King, IIId7142b72017-09-01 13:00:36 -0700229# Clean up
230RUN rm -rf /var/cache/apt/* && \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700231 rm -rf /var/lib/apt/lists/* && \
232 rm -rf /tmp/* && \
233 rm -rf /var/tmp/*
234
235ENV THRIFT_ROOT /thrift
236RUN mkdir -p $THRIFT_ROOT/src
237COPY Dockerfile $THRIFT_ROOT/
238WORKDIR $THRIFT_ROOT/src