blob: 40f9c55c62a08304a4ab3cb0f19205c7a5f4d76e [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
jfarrelle03f7e82015-02-18 23:25:54 -050013#
James E. King, III0ad20bd2017-09-30 15:44:16 -070014# Apache Thrift Docker build environment for Ubuntu Trusty
15# Using all stock Ubuntu Trusty packaging except for:
16# - d: does not come with Ubuntu so we're installing 2.070.0
17# - dart: does not come with Ubuntu so we're installing 1.20.1
18# - dotnetcore, disabled because netcore is for 1.0.0-preview and 2.0.0 is out
19# - haxe, disabled because the distro comes with 3.0.0 and it cores while installing
20# - node.js, disabled because it is at 0.10.0 in the distro which is too old (need 4+)
21# - ocaml, disabled because it fails to install properly
22#
jfarrelle03f7e82015-02-18 23:25:54 -050023
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +090024FROM buildpack-deps:trusty-scm
jfarrelle03f7e82015-02-18 23:25:54 -050025MAINTAINER Apache Thrift <dev@thrift.apache.org>
jfarrelle03f7e82015-02-18 23:25:54 -050026ENV DEBIAN_FRONTEND noninteractive
27
Robert Lu31d5b7b2018-01-05 13:44:38 +080028### Add apt repos
29
Robert Lua15060a2017-12-28 15:29:39 +080030RUN apt-get update && \
31 apt-get dist-upgrade -y && \
James E. King, III0ad20bd2017-09-30 15:44:16 -070032 apt-get install -y --no-install-recommends \
33 apt \
34 apt-transport-https \
35 apt-utils \
36 curl \
37 dirmngr \
38 software-properties-common \
39 wget
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +090040
Robert Lu31d5b7b2018-01-05 13:44:38 +080041# D
42RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EBCF975E5BA24D5E && \
43 wget http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list && \
44 wget -qO - https://dlang.org/d-keyring.gpg | apt-key add -
45
46# Dart
47RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
48 curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > \
49 /etc/apt/sources.list.d/dart_stable.list
50
Nobuaki Sukegawa6bb12772016-03-08 01:55:31 +090051RUN apt-get update && apt-get install -y --no-install-recommends \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +090052`# General dependencies` \
James E. King, III0ad20bd2017-09-30 15:44:16 -070053 bash-completion \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090054 bison \
Nobuaki Sukegawa6bb12772016-03-08 01:55:31 +090055 build-essential \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090056 clang \
57 cmake \
58 debhelper \
59 flex \
James E. King, III0ad20bd2017-09-30 15:44:16 -070060 gdb \
61 llvm \
Nobuaki Sukegawa6bb12772016-03-08 01:55:31 +090062 ninja-build \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +090063 pkg-config \
James E. King, III0ad20bd2017-09-30 15:44:16 -070064 valgrind \
65 vim
66ENV PATH /usr/lib/llvm-3.8/bin:$PATH
jfarrelle03f7e82015-02-18 23:25:54 -050067
James E. King, III43e959b2017-04-04 13:04:29 -040068RUN apt-get install -y --no-install-recommends \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +090069`# C++ dependencies` \
James E. King, III0ad20bd2017-09-30 15:44:16 -070070 libboost-all-dev \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090071 libevent-dev \
Nobuaki Sukegawa6bb12772016-03-08 01:55:31 +090072 libssl-dev \
73 qt5-default \
74 qtbase5-dev \
75 qtbase5-dev-tools
jfarrelle03f7e82015-02-18 23:25:54 -050076
James E. King, III43e959b2017-04-04 13:04:29 -040077RUN apt-get install -y --no-install-recommends \
James E. King, III0ad20bd2017-09-30 15:44:16 -070078`# csharp (mono) dependencies` \
79 mono-devel
80
Robert Lu31d5b7b2018-01-05 13:44:38 +080081RUN apt-get install -y --no-install-recommends \
James E. King, III0ad20bd2017-09-30 15:44:16 -070082`# D dependencies` \
83 dmd-bin=2.070.2-0 \
84 libphobos2-dev=2.070.2-0 \
85 dub \
86 dfmt \
87 dscanner \
88 xdg-utils
James E. King IIIf338d572018-01-29 14:51:24 -050089RUN mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
90 curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
91 mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
92 mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \
93 rm -rf libevent-master
94RUN curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
95 mv openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
96 mv openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
97 rm -rf openssl-master
James E. King, III0ad20bd2017-09-30 15:44:16 -070098
Robert Lu31d5b7b2018-01-05 13:44:38 +080099RUN apt-get install -y --no-install-recommends \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700100`# Dart dependencies` \
101 dart=1.20.1-1
102ENV PATH /usr/lib/dart/bin:$PATH
103
104RUN apt-get install -y --no-install-recommends \
105`# Erlang dependencies` \
106 erlang-base \
107 erlang-eunit \
108 erlang-dev \
109 erlang-tools \
110 rebar
111
112RUN apt-get install -y --no-install-recommends \
113`# GlibC dependencies` \
114 libglib2.0-dev
115
116RUN apt-get install -y --no-install-recommends \
117`# golang (go) dependencies` \
118 golang-go
119
120RUN apt-get install -y --no-install-recommends \
121`# Haskell dependencies` \
122 ghc \
123 cabal-install
124
125# disabled because it cores while installing
126# RUN apt-get install -y --no-install-recommends \
127# `# Haxe dependencies` \
128# haxe \
129# neko \
130# neko-dev && \
131# haxelib setup /usr/share/haxe/lib && \
132# haxelib install hxcpp 3.2.102
133
134RUN apt-get install -y --no-install-recommends \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900135`# Java dependencies` \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900136 ant \
Nobuaki Sukegawa6bb12772016-03-08 01:55:31 +0900137 ant-optional \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900138 openjdk-7-jdk \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900139 maven
jfarrelle03f7e82015-02-18 23:25:54 -0500140
James E. King, III43e959b2017-04-04 13:04:29 -0400141RUN apt-get install -y --no-install-recommends \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700142`# Lua dependencies` \
143 lua5.1 \
144 lua5.1-dev
145
146# disabled because it is too old
147# RUN apt-get install -y --no-install-recommends \
148# `# Node.js dependencies` \
149# nodejs \
150# npm
151
152# disabled because it fails to install properly
153# RUN apt-get install -y --no-install-recommends \
154# `# OCaml dependencies` \
155# ocaml \
156# opam && \
157# opam init --yes && \
158# opam install --yes oasis
jfarrelle03f7e82015-02-18 23:25:54 -0500159
James E. King, III43e959b2017-04-04 13:04:29 -0400160RUN apt-get install -y --no-install-recommends \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900161`# Perl dependencies` \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900162 libbit-vector-perl \
163 libclass-accessor-class-perl \
164 libcrypt-ssleay-perl \
165 libio-socket-ssl-perl \
166 libnet-ssleay-perl
jfarrelle03f7e82015-02-18 23:25:54 -0500167
James E. King, III43e959b2017-04-04 13:04:29 -0400168RUN apt-get install -y --no-install-recommends \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900169`# Php dependencies` \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900170 php5 \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900171 php5-cli \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700172 php5-dev \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900173 php-pear \
Robert Lua15060a2017-12-28 15:29:39 +0800174 re2c && \
175 wget https://getcomposer.org/installer -O - -q | php -- --quiet --install-dir=/usr/local/bin/ --filename=composer
jfarrelle03f7e82015-02-18 23:25:54 -0500176
James E. King, III43e959b2017-04-04 13:04:29 -0400177RUN apt-get install -y --no-install-recommends \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700178`# Python dependencies` \
179 python-all \
180 python-all-dbg \
181 python-all-dev \
182 python-pip \
183 python-setuptools \
184 python-six \
185 python-twisted \
186 python-wheel \
187 python-zope.interface \
188 python3-all \
189 python3-all-dbg \
190 python3-all-dev \
191 python3-pip \
192 python3-setuptools \
193 python3-six \
194 python3-wheel \
195 python3-zope.interface && \
196 pip install -U ipaddress backports.ssl_match_hostname tornado && \
Robert Lua15060a2017-12-28 15:29:39 +0800197 pip3 install -U backports.ssl_match_hostname tornado
James E. King, III0ad20bd2017-09-30 15:44:16 -0700198# installing tornado by pip/pip3 instead of debian package
199# if we install the debian package, the build fails in py2
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900200
James E. King, III43e959b2017-04-04 13:04:29 -0400201RUN apt-get install -y --no-install-recommends \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700202`# Ruby dependencies` \
203 ruby \
204 ruby-dev \
205 ruby-bundler
206RUN gem install bundler --no-ri --no-rdoc
207
208RUN apt-get install -y --no-install-recommends \
209`# Rust dependencies` \
210 cargo \
211 rustc
212
213RUN apt-get install -y --no-install-recommends \
214`# Static Code Analysis dependencies` \
215 cppcheck \
216 sloccount && \
217 pip install flake8
218
Alex Volanis7004a612018-01-24 10:30:13 -0500219# Install BouncyCastle provider to fix Java builds issues with JDK 7
220# Builds accessing repote repositories fail as seen here: https://github.com/travis-ci/travis-ci/issues/8503
221RUN apt-get install -y --no-install-recommends \
222`# BouncyCastle JCE Provider dependencies` \
223 libbcprov-java && \
224 ln -s /usr/share/java/bcprov.jar /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext/bcprov.jar && \
225 awk -F . -v OFS=. 'BEGIN{n=2}/^security\.provider/ {split($3, posAndEquals, "=");$3=n++"="posAndEquals[2];print;next} 1' /etc/java-7-openjdk/security/java.security > /tmp/java.security && \
226 echo "security.provider.1=org.bouncycastle.jce.provider.BouncyCastleProvider" >> /tmp/java.security && \
227 mv /tmp/java.security /etc/java-7-openjdk/security/java.security
228
James E. King, III0ad20bd2017-09-30 15:44:16 -0700229# Clean up
230RUN rm -rf /var/cache/apt/* && \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900231 rm -rf /var/lib/apt/lists/* && \
232 rm -rf /tmp/* && \
233 rm -rf /var/tmp/*
234
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900235ENV THRIFT_ROOT /thrift
236RUN mkdir -p $THRIFT_ROOT/src
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +0900237COPY Dockerfile $THRIFT_ROOT/
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900238WORKDIR $THRIFT_ROOT/src