1# 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 Debian
14#
15# Known missing client libraries:
16#  - dotnetcore
17#  - rust
18
19FROM buildpack-deps:jessie-scm
20MAINTAINER Apache Thrift <dev@thrift.apache.org>
21
22ENV DEBIAN_FRONTEND noninteractive
23
24# Add apt sources
25# jessie-backports for cmake and some ruby bits
26RUN echo "deb http://ftp.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list
27
28# Dart
29RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
30    curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list && \
31    sed -i /etc/apt/sources.list.d/dart_stable.list -e 's/https:/http:/g'
32
33RUN apt-get update && apt-get install -y --no-install-recommends \
34`# General dependencies` \
35      bison \
36      build-essential \
37      clang \
38      debhelper \
39      flex \
40      pkg-config && \
41    apt-get -t jessie-backports install -y --no-install-recommends cmake
42
43RUN apt-get install -y --no-install-recommends \
44`# C++ dependencies` \
45      libboost-dev \
46      libboost-filesystem-dev \
47      libboost-program-options-dev \
48      libboost-system-dev \
49      libboost-test-dev \
50      libboost-thread-dev \
51      libevent-dev \
52      libssl-dev \
53      qt5-default \
54      qtbase5-dev \
55      qtbase5-dev-tools
56
57RUN apt-get install -y --no-install-recommends \
58`# Java dependencies` \
59      ant \
60      ant-optional \
61      openjdk-7-jdk \
62      maven
63
64RUN apt-get install -y --no-install-recommends \
65`# Python dependencies` \
66      python-all \
67      python-all-dbg \
68      python-all-dev \
69      python-pip \
70      python-setuptools \
71      python-twisted \
72      python-zope.interface \
73      python3-all \
74      python3-all-dbg \
75      python3-all-dev \
76      python3-setuptools \
77      python3-pip
78
79RUN apt-get install -y --no-install-recommends \
80`# Ruby dependencies` \
81      ruby \
82      ruby-bundler \
83      ruby-dev \
84`# Perl dependencies` \
85      libbit-vector-perl \
86      libclass-accessor-class-perl \
87      libcrypt-ssleay-perl \
88      libio-socket-ssl-perl \
89      libnet-ssleay-perl
90
91RUN apt-get -t jessie-backports install -y ruby-bundler
92RUN apt-get install -y --no-install-recommends \
93`# Php dependencies` \
94      php5 \
95      php5-dev \
96      php5-cli \
97      php-pear \
98      re2c \
99      phpunit \
100`# GlibC dependencies` \
101      libglib2.0-dev
102
103RUN apt-get update && apt-get install -y --no-install-recommends \
104`# Erlang dependencies` \
105      erlang-base \
106      erlang-eunit \
107      erlang-dev \
108      erlang-tools \
109      rebar
110
111RUN apt-get update && apt-get install -y --no-install-recommends \
112`# Haxe dependencies` \
113      neko \
114      neko-dev \
115      libneko0
116
117RUN apt-get update && apt-get install -y --no-install-recommends \
118`# Node.js dependencies` \
119      nodejs \
120      nodejs-dev \
121      nodejs-legacy \
122      npm
123
124RUN apt-get update && apt-get install -y --no-install-recommends \
125`# D dependencies` \
126      xdg-utils \
127`# Dart dependencies` \
128      dart \
129`# Lua dependencies` \
130      lua5.2 \
131      lua5.2-dev \
132`# MinGW dependencies` \
133      mingw32 \
134      mingw32-binutils \
135`#      mingw32-runtime` \
136      nsis \
137`# Clean up` \
138    && rm -rf /var/cache/apt/* && \
139    rm -rf /var/lib/apt/lists/* && \
140    rm -rf /tmp/* && \
141    rm -rf /var/tmp/*
142
143# Ruby
144RUN gem install bundler --no-ri --no-rdoc
145
146# Python optional dependencies
147RUN pip2 install -U ipaddress backports.ssl_match_hostname tornado
148RUN pip3 install -U backports.ssl_match_hostname tornado
149
150# Go
151RUN curl -sSL https://storage.googleapis.com/golang/go1.4.3.linux-amd64.tar.gz | tar -C /usr/local/ -xz
152ENV PATH /usr/local/go/bin:$PATH
153
154# Haxe
155RUN mkdir -p /usr/lib/haxe && \
156    wget -O - https://github.com/HaxeFoundation/haxe/releases/download/3.2.1/haxe-3.2.1-linux64.tar.gz | \
157    tar -C /usr/lib/haxe --strip-components=1 -xz && \
158    ln -s /usr/lib/haxe/haxe /usr/bin/haxe && \
159    ln -s /usr/lib/haxe/haxelib /usr/bin/haxelib && \
160    mkdir -p /usr/lib/haxe/lib  && \
161    chmod -R 777 /usr/lib/haxe/lib && \
162    haxelib setup /usr/lib/haxe/lib && \
163    haxelib install hxcpp
164
165# D
166RUN curl -sSL http://downloads.dlang.org/releases/2.x/2.070.0/dmd_2.070.0-0_amd64.deb -o /tmp/dmd_2.070.0-0_amd64.deb && \
167    dpkg -i /tmp/dmd_2.070.0-0_amd64.deb && \
168    rm /tmp/dmd_2.070.0-0_amd64.deb && \
169    curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
170    curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
171    mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
172    mv libevent-master/deimos/* openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
173    mv libevent-master/C/* openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
174    rm -rf libevent-master openssl-master && \
175    echo 'gcc -Wl,--no-as-needed $*' > /usr/local/bin/gcc-dmd && \
176    chmod 755 /usr/local/bin/gcc-dmd && \
177    echo 'CC=/usr/local/bin/gcc-dmd' >> /etc/dmd.conf
178
179# Dart
180ENV PATH /usr/lib/dart/bin:$PATH
181
182# OCaml
183RUN echo 'deb http://ppa.launchpad.net/avsm/ppa/ubuntu trusty main' > /etc/apt/sources.list.d/avsm-official-ocaml.list && \
184    gpg --keyserver keyserver.ubuntu.com --recv 61707B09 && \
185    gpg --export --armor 61707B09 | apt-key add - && \
186    apt-get update && \
187    apt-get install -y ocaml opam && \
188    opam init && \
189    opam install oasis
190
191# Force utf8 locale to successfully build Haskell tf-random
192ENV LC_ALL C.UTF-8
193
194ENV THRIFT_ROOT /thrift
195RUN mkdir -p $THRIFT_ROOT/src
196COPY Dockerfile $THRIFT_ROOT/
197WORKDIR $THRIFT_ROOT/src
198