blob: a8e4d3baa25ae2960a40e13b8b980f16ba424daf [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
John Boiles57852792018-01-05 14:37:05 -0800116# golang
117ENV GOLANG_VERSION 1.7.6
118ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
119ENV GOLANG_DOWNLOAD_SHA256 ad5808bf42b014c22dd7646458f631385003049ded0bb6af2efc7f1f79fa29ea
120RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \
121 echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \
122 tar -C /usr/local -xzf golang.tar.gz && \
123 ln -s /usr/local/go/bin/go /usr/local/bin && \
124 rm golang.tar.gz
James E. King, III0ad20bd2017-09-30 15:44:16 -0700125
126RUN apt-get install -y --no-install-recommends \
127`# Haskell dependencies` \
128 ghc \
129 cabal-install
130
131# disabled because it cores while installing
132# RUN apt-get install -y --no-install-recommends \
133# `# Haxe dependencies` \
134# haxe \
135# neko \
136# neko-dev && \
137# haxelib setup /usr/share/haxe/lib && \
138# haxelib install hxcpp 3.2.102
139
140RUN apt-get install -y --no-install-recommends \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900141`# Java dependencies` \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900142 ant \
Nobuaki Sukegawa6bb12772016-03-08 01:55:31 +0900143 ant-optional \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900144 openjdk-7-jdk \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900145 maven
jfarrelle03f7e82015-02-18 23:25:54 -0500146
James E. King, III43e959b2017-04-04 13:04:29 -0400147RUN apt-get install -y --no-install-recommends \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700148`# Lua dependencies` \
149 lua5.1 \
150 lua5.1-dev
151
152# disabled because it is too old
153# RUN apt-get install -y --no-install-recommends \
154# `# Node.js dependencies` \
155# nodejs \
156# npm
157
158# disabled because it fails to install properly
159# RUN apt-get install -y --no-install-recommends \
160# `# OCaml dependencies` \
161# ocaml \
162# opam && \
163# opam init --yes && \
164# opam install --yes oasis
jfarrelle03f7e82015-02-18 23:25:54 -0500165
James E. King, III43e959b2017-04-04 13:04:29 -0400166RUN apt-get install -y --no-install-recommends \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900167`# Perl dependencies` \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900168 libbit-vector-perl \
169 libclass-accessor-class-perl \
170 libcrypt-ssleay-perl \
171 libio-socket-ssl-perl \
172 libnet-ssleay-perl
jfarrelle03f7e82015-02-18 23:25:54 -0500173
James E. King, III43e959b2017-04-04 13:04:29 -0400174RUN apt-get install -y --no-install-recommends \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900175`# Php dependencies` \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900176 php5 \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900177 php5-cli \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700178 php5-dev \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900179 php-pear \
Robert Lua15060a2017-12-28 15:29:39 +0800180 re2c && \
181 wget https://getcomposer.org/installer -O - -q | php -- --quiet --install-dir=/usr/local/bin/ --filename=composer
jfarrelle03f7e82015-02-18 23:25:54 -0500182
James E. King, III43e959b2017-04-04 13:04:29 -0400183RUN apt-get install -y --no-install-recommends \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700184`# Python dependencies` \
185 python-all \
186 python-all-dbg \
187 python-all-dev \
188 python-pip \
189 python-setuptools \
190 python-six \
191 python-twisted \
192 python-wheel \
193 python-zope.interface \
194 python3-all \
195 python3-all-dbg \
196 python3-all-dev \
197 python3-pip \
198 python3-setuptools \
199 python3-six \
200 python3-wheel \
201 python3-zope.interface && \
202 pip install -U ipaddress backports.ssl_match_hostname tornado && \
Robert Lua15060a2017-12-28 15:29:39 +0800203 pip3 install -U backports.ssl_match_hostname tornado
James E. King, III0ad20bd2017-09-30 15:44:16 -0700204# installing tornado by pip/pip3 instead of debian package
205# if we install the debian package, the build fails in py2
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900206
James E. King, III43e959b2017-04-04 13:04:29 -0400207RUN apt-get install -y --no-install-recommends \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700208`# Ruby dependencies` \
209 ruby \
210 ruby-dev \
211 ruby-bundler
212RUN gem install bundler --no-ri --no-rdoc
213
214RUN apt-get install -y --no-install-recommends \
215`# Rust dependencies` \
216 cargo \
217 rustc
218
219RUN apt-get install -y --no-install-recommends \
220`# Static Code Analysis dependencies` \
221 cppcheck \
222 sloccount && \
223 pip install flake8
224
Alex Volanis7004a612018-01-24 10:30:13 -0500225# Install BouncyCastle provider to fix Java builds issues with JDK 7
226# Builds accessing repote repositories fail as seen here: https://github.com/travis-ci/travis-ci/issues/8503
227RUN apt-get install -y --no-install-recommends \
228`# BouncyCastle JCE Provider dependencies` \
229 libbcprov-java && \
230 ln -s /usr/share/java/bcprov.jar /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext/bcprov.jar && \
231 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 && \
232 echo "security.provider.1=org.bouncycastle.jce.provider.BouncyCastleProvider" >> /tmp/java.security && \
233 mv /tmp/java.security /etc/java-7-openjdk/security/java.security
234
James E. King, III0ad20bd2017-09-30 15:44:16 -0700235# Clean up
236RUN rm -rf /var/cache/apt/* && \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900237 rm -rf /var/lib/apt/lists/* && \
238 rm -rf /tmp/* && \
239 rm -rf /var/tmp/*
240
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900241ENV THRIFT_ROOT /thrift
242RUN mkdir -p $THRIFT_ROOT/src
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +0900243COPY Dockerfile $THRIFT_ROOT/
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900244WORKDIR $THRIFT_ROOT/src