blob: 02f0b1e5d92684fb4a851aa814f159fbbfa4b108 [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 \
Roger Meiere0ccbd62017-01-16 20:26:57 +010098 ruby-bundler \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +090099`# Perl dependencies` \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900100 libbit-vector-perl \
101 libclass-accessor-class-perl \
102 libcrypt-ssleay-perl \
103 libio-socket-ssl-perl \
104 libnet-ssleay-perl
jfarrelle03f7e82015-02-18 23:25:54 -0500105
Nobuaki Sukegawa6bb12772016-03-08 01:55:31 +0900106RUN apt-get update && apt-get install -y --no-install-recommends \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900107`# Php dependencies` \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900108 php5 \
109 php5-dev \
110 php5-cli \
111 php-pear \
112 re2c \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900113 phpunit \
114`# GlibC dependencies` \
115 libglib2.0-dev
jfarrelle03f7e82015-02-18 23:25:54 -0500116
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900117RUN apt-get update && apt-get install -y --no-install-recommends \
118`# Erlang dependencies` \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900119 erlang-base \
120 erlang-eunit \
121 erlang-dev \
122 erlang-tools \
123 rebar
jfarrelle03f7e82015-02-18 23:25:54 -0500124
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900125RUN apt-get update && apt-get install -y --no-install-recommends \
126`# Haskell dependencies` \
127 ghc \
128 cabal-install \
129`# Haxe dependencies` \
130 neko \
131 neko-dev \
132 libneko0
133
134RUN apt-get update && apt-get install -y --no-install-recommends \
135`# Node.js dependencies` \
136 nodejs \
137 nodejs-dev \
Nobuaki Sukegawa4b7dbe32016-05-25 12:09:02 +0900138 nodejs-legacy
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900139
140RUN apt-get update && apt-get install -y --no-install-recommends \
141`# CSharp dependencies` \
142 libmono-system-web2.0-cil \
Nobuaki Sukegawa080041c2016-09-04 18:49:19 +0900143 mono-devel
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900144
145RUN apt-get update && apt-get install -y --no-install-recommends \
146`# D dependencies` \
147 xdg-utils \
148`# Dart dependencies` \
149 dart \
150`# Lua dependencies` \
151 lua5.2 \
152 lua5.2-dev \
153`# MinGW dependencies` \
154 mingw32 \
155 mingw32-binutils \
156 mingw32-runtime \
157 nsis \
158`# Clean up` \
159 && rm -rf /var/cache/apt/* && \
160 rm -rf /var/lib/apt/lists/* && \
161 rm -rf /tmp/* && \
162 rm -rf /var/tmp/*
163
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900164# Ruby
Nobuaki Sukegawa080041c2016-09-04 18:49:19 +0900165RUN gem install bundler --no-ri --no-rdoc
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900166
Nobuaki Sukegawabf9fa902016-09-04 18:49:21 +0900167# Python optional dependencies
168RUN pip2 install -U ipaddress backports.ssl_match_hostname tornado
169RUN pip3 install -U backports.ssl_match_hostname tornado
170
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900171# Go
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900172RUN curl -sSL https://storage.googleapis.com/golang/go1.4.3.linux-amd64.tar.gz | tar -C /usr/local/ -xz
173ENV PATH /usr/local/go/bin:$PATH
jfarrell763841b2015-06-24 09:11:54 -0400174
jfarrelle03f7e82015-02-18 23:25:54 -0500175# Haxe
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900176RUN mkdir -p /usr/lib/haxe && \
Nobuaki Sukegawa6bb12772016-03-08 01:55:31 +0900177 curl http://haxe.org/website-content/downloads/3.2.0/downloads/haxe-3.2.0-linux64.tar.gz | \
178 tar -C /usr/lib/haxe --strip-components=1 -xz && \
jfarrelle03f7e82015-02-18 23:25:54 -0500179 ln -s /usr/lib/haxe/haxe /usr/bin/haxe && \
180 ln -s /usr/lib/haxe/haxelib /usr/bin/haxelib && \
jfarrelle03f7e82015-02-18 23:25:54 -0500181 mkdir -p /usr/lib/haxe/lib && \
182 chmod -R 777 /usr/lib/haxe/lib && \
183 haxelib setup /usr/lib/haxe/lib && \
Nobuaki Sukegawa6bb12772016-03-08 01:55:31 +0900184 haxelib install hxcpp
jfarrelle03f7e82015-02-18 23:25:54 -0500185
Nobuaki Sukegawa4b7dbe32016-05-25 12:09:02 +0900186# Node.js
187RUN curl -sSL https://www.npmjs.com/install.sh | sh
188
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900189# D
190RUN 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 +0900191 dpkg -i /tmp/dmd_2.070.0-0_amd64.deb && \
Nobuaki Sukegawaeee04d92016-02-22 22:13:31 +0900192 rm /tmp/dmd_2.070.0-0_amd64.deb && \
193 curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
194 curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
195 mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
196 mv libevent-master/deimos/* openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
197 mv libevent-master/C/* openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
198 rm -rf libevent-master openssl-master && \
199 echo 'gcc -Wl,--no-as-needed $*' > /usr/local/bin/gcc-dmd && \
200 chmod 755 /usr/local/bin/gcc-dmd && \
201 echo 'CC=/usr/local/bin/gcc-dmd' >> /etc/dmd.conf
jfarrelle03f7e82015-02-18 23:25:54 -0500202
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900203# Dart
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900204ENV PATH /usr/lib/dart/bin:$PATH
205
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900206ENV THRIFT_ROOT /thrift
207RUN mkdir -p $THRIFT_ROOT/src
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +0900208COPY Dockerfile $THRIFT_ROOT/
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900209WORKDIR $THRIFT_ROOT/src