blob: 99f0a8fe941d598561d0756b92af7ec621e748ef [file] [log] [blame]
jfarrelle03f7e82015-02-18 23:25:54 -05001# 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 Centos
14#
15# Known missing client libraries:
16# - None
17
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +090018FROM buildpack-deps:trusty-scm
jfarrelle03f7e82015-02-18 23:25:54 -050019MAINTAINER Apache Thrift <dev@thrift.apache.org>
20
jfarrelle03f7e82015-02-18 23:25:54 -050021ENV DEBIAN_FRONTEND noninteractive
22
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +090023# Add apt sources
24# Erlang
25RUN echo 'deb http://packages.erlang-solutions.com/debian trusty contrib' > /etc/apt/sources.list.d/erlang_solutions.list && \
26 curl -sSL https://packages.erlang-solutions.com/debian/erlang_solutions.asc | apt-key add -
27# Dart
28RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
29 curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list && \
30 sed -i /etc/apt/sources.list.d/dart_stable.list -e 's/https:/http:/g'
31
32# Consider using mirror nearby when building locally
33# TODO: Provide option via --build-arg=...
34# RUN sed -i /etc/apt/sources.list -e 's!http://archive.ubuntu.com/ubuntu/!http://your/mirror/!g'
35
Nobuaki Sukegawa6bb12772016-03-08 01:55:31 +090036RUN apt-get update && apt-get install -y --no-install-recommends \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +090037`# General dependencies` \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090038 bison \
Nobuaki Sukegawa6bb12772016-03-08 01:55:31 +090039 build-essential \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090040 clang \
41 cmake \
42 debhelper \
43 flex \
Nobuaki Sukegawa6bb12772016-03-08 01:55:31 +090044 ninja-build \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +090045 pkg-config \
46`# Included in buildpack-deps` \
47`# autoconf` \
48`# automake` \
49`# g++` \
50`# git` \
51`# libtool` \
52`# make`
jfarrelle03f7e82015-02-18 23:25:54 -050053
Nobuaki Sukegawa6bb12772016-03-08 01:55:31 +090054RUN apt-get update && apt-get install -y --no-install-recommends \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +090055`# C++ dependencies` \
56`# libevent and OpenSSL are needed by D too` \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090057 libboost-dev \
58 libboost-filesystem-dev \
59 libboost-program-options-dev \
60 libboost-system-dev \
61 libboost-test-dev \
62 libboost-thread-dev \
63 libevent-dev \
Nobuaki Sukegawa6bb12772016-03-08 01:55:31 +090064 libssl-dev \
65 qt5-default \
66 qtbase5-dev \
67 qtbase5-dev-tools
jfarrelle03f7e82015-02-18 23:25:54 -050068
Nobuaki Sukegawa6bb12772016-03-08 01:55:31 +090069RUN apt-get update && apt-get install -y --no-install-recommends \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +090070`# Java dependencies` \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090071 ant \
Nobuaki Sukegawa6bb12772016-03-08 01:55:31 +090072 ant-optional \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090073 openjdk-7-jdk \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +090074 maven
jfarrelle03f7e82015-02-18 23:25:54 -050075
Nobuaki Sukegawaed23b2b2016-02-28 13:47:44 +090076RUN apt-get update && apt-get install -y --no-install-recommends \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +090077`# Python dependencies` \
78`# TODO:` \
79`# Install twisted and zope.interface via pip. we need twisted at ./configure time, otherwise` \
80`# py.twisted tests are skipped.` \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090081 python-all \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090082 python-all-dbg \
Nobuaki Sukegawaed23b2b2016-02-28 13:47:44 +090083 python-all-dev \
84 python-pip \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090085 python-setuptools \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090086 python-twisted \
87 python-zope.interface \
Nobuaki Sukegawaf43d0ca2016-03-25 09:22:16 +090088 python3-all \
89 python3-all-dbg \
90 python3-all-dev \
91 python3-setuptools \
Nobuaki Sukegawa25536ad2016-02-04 15:08:55 +090092 python3-pip
jfarrelle03f7e82015-02-18 23:25:54 -050093
Nobuaki Sukegawa6bb12772016-03-08 01:55:31 +090094RUN apt-get update && apt-get install -y --no-install-recommends \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +090095`# Ruby dependencies` \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090096 ruby \
97 ruby-dev \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +090098`# Perl dependencies` \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090099 libbit-vector-perl \
100 libclass-accessor-class-perl \
101 libcrypt-ssleay-perl \
102 libio-socket-ssl-perl \
103 libnet-ssleay-perl
jfarrelle03f7e82015-02-18 23:25:54 -0500104
Nobuaki Sukegawa6bb12772016-03-08 01:55:31 +0900105RUN apt-get update && apt-get install -y --no-install-recommends \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900106`# Php dependencies` \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900107 php5 \
108 php5-dev \
109 php5-cli \
110 php-pear \
111 re2c \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900112 phpunit \
113`# GlibC dependencies` \
114 libglib2.0-dev
jfarrelle03f7e82015-02-18 23:25:54 -0500115
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900116RUN apt-get update && apt-get install -y --no-install-recommends \
117`# Erlang dependencies` \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900118 erlang-base \
119 erlang-eunit \
120 erlang-dev \
121 erlang-tools \
122 rebar
jfarrelle03f7e82015-02-18 23:25:54 -0500123
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900124RUN apt-get update && apt-get install -y --no-install-recommends \
125`# Haskell dependencies` \
126 ghc \
127 cabal-install \
128`# Haxe dependencies` \
129 neko \
130 neko-dev \
131 libneko0
132
133RUN apt-get update && apt-get install -y --no-install-recommends \
134`# Node.js dependencies` \
135 nodejs \
136 nodejs-dev \
Nobuaki Sukegawa4b7dbe32016-05-25 12:09:02 +0900137 nodejs-legacy
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900138
139RUN apt-get update && apt-get install -y --no-install-recommends \
140`# CSharp dependencies` \
141 libmono-system-web2.0-cil \
Nobuaki Sukegawa080041c2016-09-04 18:49:19 +0900142 mono-devel
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900143
144RUN apt-get update && apt-get install -y --no-install-recommends \
145`# D dependencies` \
146 xdg-utils \
147`# Dart dependencies` \
148 dart \
149`# Lua dependencies` \
150 lua5.2 \
151 lua5.2-dev \
152`# MinGW dependencies` \
153 mingw32 \
154 mingw32-binutils \
155 mingw32-runtime \
156 nsis \
157`# Clean up` \
158 && rm -rf /var/cache/apt/* && \
159 rm -rf /var/lib/apt/lists/* && \
160 rm -rf /tmp/* && \
161 rm -rf /var/tmp/*
162
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900163# Ruby
Nobuaki Sukegawa080041c2016-09-04 18:49:19 +0900164RUN gem install bundler --no-ri --no-rdoc
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900165
166# Go
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900167RUN curl -sSL https://storage.googleapis.com/golang/go1.4.3.linux-amd64.tar.gz | tar -C /usr/local/ -xz
168ENV PATH /usr/local/go/bin:$PATH
jfarrell763841b2015-06-24 09:11:54 -0400169
jfarrelle03f7e82015-02-18 23:25:54 -0500170# Haxe
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900171RUN mkdir -p /usr/lib/haxe && \
Nobuaki Sukegawa6bb12772016-03-08 01:55:31 +0900172 curl http://haxe.org/website-content/downloads/3.2.0/downloads/haxe-3.2.0-linux64.tar.gz | \
173 tar -C /usr/lib/haxe --strip-components=1 -xz && \
jfarrelle03f7e82015-02-18 23:25:54 -0500174 ln -s /usr/lib/haxe/haxe /usr/bin/haxe && \
175 ln -s /usr/lib/haxe/haxelib /usr/bin/haxelib && \
jfarrelle03f7e82015-02-18 23:25:54 -0500176 mkdir -p /usr/lib/haxe/lib && \
177 chmod -R 777 /usr/lib/haxe/lib && \
178 haxelib setup /usr/lib/haxe/lib && \
Nobuaki Sukegawa6bb12772016-03-08 01:55:31 +0900179 haxelib install hxcpp
jfarrelle03f7e82015-02-18 23:25:54 -0500180
Nobuaki Sukegawa4b7dbe32016-05-25 12:09:02 +0900181# Node.js
182RUN curl -sSL https://www.npmjs.com/install.sh | sh
183
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900184# D
185RUN 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 && \
Nobuaki Sukegawa33de26c2016-02-22 01:43:23 +0900186 dpkg -i /tmp/dmd_2.070.0-0_amd64.deb && \
Nobuaki Sukegawaeee04d92016-02-22 22:13:31 +0900187 rm /tmp/dmd_2.070.0-0_amd64.deb && \
188 curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
189 curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
190 mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
191 mv libevent-master/deimos/* openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
192 mv libevent-master/C/* openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
193 rm -rf libevent-master openssl-master && \
194 echo 'gcc -Wl,--no-as-needed $*' > /usr/local/bin/gcc-dmd && \
195 chmod 755 /usr/local/bin/gcc-dmd && \
196 echo 'CC=/usr/local/bin/gcc-dmd' >> /etc/dmd.conf
jfarrelle03f7e82015-02-18 23:25:54 -0500197
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900198# Dart
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900199ENV PATH /usr/lib/dart/bin:$PATH
200
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900201ENV THRIFT_ROOT /thrift
202RUN mkdir -p $THRIFT_ROOT/src
203COPY scripts $THRIFT_ROOT
204WORKDIR $THRIFT_ROOT/src