blob: 89f683e4bcf28732aa490befc65a5dc626e3ada1 [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`# D dependencies` \
79 dmd-bin=2.070.2-0 \
80 libphobos2-dev=2.070.2-0 \
81 dub \
82 dfmt \
83 dscanner \
84 xdg-utils
James E. King IIIf338d572018-01-29 14:51:24 -050085RUN mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
86 curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
87 mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
88 mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \
89 rm -rf libevent-master
90RUN curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
91 mv openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
92 mv openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
93 rm -rf openssl-master
James E. King, III0ad20bd2017-09-30 15:44:16 -070094
Robert Lu31d5b7b2018-01-05 13:44:38 +080095RUN apt-get install -y --no-install-recommends \
James E. King, III0ad20bd2017-09-30 15:44:16 -070096`# Dart dependencies` \
97 dart=1.20.1-1
98ENV PATH /usr/lib/dart/bin:$PATH
99
100RUN apt-get install -y --no-install-recommends \
101`# Erlang dependencies` \
102 erlang-base \
103 erlang-eunit \
104 erlang-dev \
105 erlang-tools \
106 rebar
107
108RUN apt-get install -y --no-install-recommends \
109`# GlibC dependencies` \
110 libglib2.0-dev
111
John Boiles57852792018-01-05 14:37:05 -0800112# golang
113ENV GOLANG_VERSION 1.7.6
114ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
115ENV GOLANG_DOWNLOAD_SHA256 ad5808bf42b014c22dd7646458f631385003049ded0bb6af2efc7f1f79fa29ea
116RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \
117 echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \
118 tar -C /usr/local -xzf golang.tar.gz && \
119 ln -s /usr/local/go/bin/go /usr/local/bin && \
120 rm golang.tar.gz
James E. King, III0ad20bd2017-09-30 15:44:16 -0700121
James E. King, III0ad20bd2017-09-30 15:44:16 -0700122# disabled because it cores while installing
123# RUN apt-get install -y --no-install-recommends \
124# `# Haxe dependencies` \
125# haxe \
126# neko \
127# neko-dev && \
128# haxelib setup /usr/share/haxe/lib && \
129# haxelib install hxcpp 3.2.102
130
131RUN apt-get install -y --no-install-recommends \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900132`# Java dependencies` \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900133 ant \
Nobuaki Sukegawa6bb12772016-03-08 01:55:31 +0900134 ant-optional \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900135 openjdk-7-jdk \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900136 maven
jfarrelle03f7e82015-02-18 23:25:54 -0500137
James E. King, III43e959b2017-04-04 13:04:29 -0400138RUN apt-get install -y --no-install-recommends \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700139`# Lua dependencies` \
140 lua5.1 \
141 lua5.1-dev
142
143# disabled because it is too old
144# RUN apt-get install -y --no-install-recommends \
145# `# Node.js dependencies` \
146# nodejs \
147# npm
148
149# disabled because it fails to install properly
150# RUN apt-get install -y --no-install-recommends \
151# `# OCaml dependencies` \
152# ocaml \
153# opam && \
154# opam init --yes && \
155# opam install --yes oasis
jfarrelle03f7e82015-02-18 23:25:54 -0500156
James E. King, III43e959b2017-04-04 13:04:29 -0400157RUN apt-get install -y --no-install-recommends \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900158`# Perl dependencies` \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900159 libbit-vector-perl \
160 libclass-accessor-class-perl \
161 libcrypt-ssleay-perl \
162 libio-socket-ssl-perl \
163 libnet-ssleay-perl
jfarrelle03f7e82015-02-18 23:25:54 -0500164
James E. King, III43e959b2017-04-04 13:04:29 -0400165RUN apt-get install -y --no-install-recommends \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900166`# Php dependencies` \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900167 php5 \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900168 php5-cli \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700169 php5-dev \
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900170 php-pear \
Robert Lua15060a2017-12-28 15:29:39 +0800171 re2c && \
172 wget https://getcomposer.org/installer -O - -q | php -- --quiet --install-dir=/usr/local/bin/ --filename=composer
jfarrelle03f7e82015-02-18 23:25:54 -0500173
James E. King, III43e959b2017-04-04 13:04:29 -0400174RUN apt-get install -y --no-install-recommends \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700175`# Python dependencies` \
176 python-all \
177 python-all-dbg \
178 python-all-dev \
179 python-pip \
180 python-setuptools \
181 python-six \
182 python-twisted \
183 python-wheel \
184 python-zope.interface \
185 python3-all \
186 python3-all-dbg \
187 python3-all-dev \
188 python3-pip \
189 python3-setuptools \
190 python3-six \
191 python3-wheel \
192 python3-zope.interface && \
193 pip install -U ipaddress backports.ssl_match_hostname tornado && \
Robert Lua15060a2017-12-28 15:29:39 +0800194 pip3 install -U backports.ssl_match_hostname tornado
James E. King, III0ad20bd2017-09-30 15:44:16 -0700195# installing tornado by pip/pip3 instead of debian package
196# if we install the debian package, the build fails in py2
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900197
James E. King, III43e959b2017-04-04 13:04:29 -0400198RUN apt-get install -y --no-install-recommends \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700199`# Ruby dependencies` \
200 ruby \
201 ruby-dev \
202 ruby-bundler
203RUN gem install bundler --no-ri --no-rdoc
204
205RUN apt-get install -y --no-install-recommends \
206`# Rust dependencies` \
207 cargo \
208 rustc
209
210RUN apt-get install -y --no-install-recommends \
211`# Static Code Analysis dependencies` \
212 cppcheck \
213 sloccount && \
214 pip install flake8
215
Alex Volanis7004a612018-01-24 10:30:13 -0500216# Install BouncyCastle provider to fix Java builds issues with JDK 7
217# Builds accessing repote repositories fail as seen here: https://github.com/travis-ci/travis-ci/issues/8503
218RUN apt-get install -y --no-install-recommends \
219`# BouncyCastle JCE Provider dependencies` \
220 libbcprov-java && \
221 ln -s /usr/share/java/bcprov.jar /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext/bcprov.jar && \
222 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 && \
223 echo "security.provider.1=org.bouncycastle.jce.provider.BouncyCastleProvider" >> /tmp/java.security && \
224 mv /tmp/java.security /etc/java-7-openjdk/security/java.security
225
James E. King, III0ad20bd2017-09-30 15:44:16 -0700226# Clean up
227RUN rm -rf /var/cache/apt/* && \
Nobuaki Sukegawa7be78ea2016-05-15 00:25:04 +0900228 rm -rf /var/lib/apt/lists/* && \
229 rm -rf /tmp/* && \
230 rm -rf /var/tmp/*
231
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900232ENV THRIFT_ROOT /thrift
233RUN mkdir -p $THRIFT_ROOT/src
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +0900234COPY Dockerfile $THRIFT_ROOT/
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900235WORKDIR $THRIFT_ROOT/src