blob: 857384b4134806b776d651dace0f6fcab139e506 [file] [log] [blame]
James E. King, III0ad20bd2017-09-30 15:44:16 -07001# 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 Ubuntu
14#
15# Known missing client libraries:
16# - dotnetcore
17
18FROM buildpack-deps:trusty-scm
19MAINTAINER Apache Thrift <dev@thrift.apache.org>
20
21ENV DEBIAN_FRONTEND noninteractive
22
23# Add apt sources
24# CMAKE
25RUN apt-get update && \
26 apt-get install -y --no-install-recommends software-properties-common && \
27 add-apt-repository -y ppa:george-edison55/cmake-3.x
28
29# Erlang
30RUN echo 'deb http://packages.erlang-solutions.com/debian trusty contrib' > /etc/apt/sources.list.d/erlang_solutions.list && \
31 curl -sSL https://packages.erlang-solutions.com/debian/erlang_solutions.asc | apt-key add -
32
33# Dart
34RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
35 curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list && \
36 sed -i /etc/apt/sources.list.d/dart_stable.list -e 's/https:/http:/g'
37
38# Consider using mirror nearby when building locally
39# TODO: Provide option via --build-arg=...
40# RUN sed -i /etc/apt/sources.list -e 's!http://archive.ubuntu.com/ubuntu/!http://your/mirror/!g'
41
42RUN apt-get update && apt-get install -y --no-install-recommends \
43`# General dependencies` \
44 bison \
45 build-essential \
46 clang \
47 cmake \
48 debhelper \
49 flex \
50 ninja-build \
51 pkg-config \
52`# Included in buildpack-deps` \
53`# autoconf` \
54`# automake` \
55`# g++` \
56`# git` \
57`# libtool` \
58`# make`
59
60RUN apt-get install -y --no-install-recommends \
61`# C++ dependencies` \
62`# libevent and OpenSSL are needed by D too` \
63 libboost-dev \
64 libboost-filesystem-dev \
65 libboost-program-options-dev \
66 libboost-system-dev \
67 libboost-test-dev \
68 libboost-thread-dev \
69 libevent-dev \
70 libssl-dev \
71 qt5-default \
72 qtbase5-dev \
73 qtbase5-dev-tools
74
75RUN apt-get install -y --no-install-recommends \
76`# Java dependencies` \
77 ant \
78 ant-optional \
79 openjdk-7-jdk \
80 maven
81
82RUN apt-get install -y --no-install-recommends \
83`# Python dependencies` \
84`# TODO:` \
85`# Install twisted and zope.interface via pip. we need twisted at ./configure time, otherwise` \
86`# py.twisted tests are skipped.` \
87 python-all \
88 python-all-dbg \
89 python-all-dev \
90 python-pip \
91 python-setuptools \
92 python-twisted \
93 python-zope.interface \
94 python3-all \
95 python3-all-dbg \
96 python3-all-dev \
97 python3-setuptools \
98 python3-pip
99
100RUN apt-get install -y --no-install-recommends \
101`# Ruby dependencies` \
102 ruby \
103 ruby-dev \
104 ruby-bundler \
105`# Perl dependencies` \
106 libbit-vector-perl \
107 libclass-accessor-class-perl \
108 libcrypt-ssleay-perl \
109 libio-socket-ssl-perl \
110 libnet-ssleay-perl
111
112RUN apt-get install -y --no-install-recommends \
113`# Php dependencies` \
114 php5 \
115 php5-dev \
116 php5-cli \
117 php-pear \
118 re2c \
119 phpunit \
120`# GlibC dependencies` \
121 libglib2.0-dev
122
123RUN apt-get update && apt-get install -y --no-install-recommends \
124`# Erlang dependencies` \
125 erlang-base \
126 erlang-eunit \
127 erlang-dev \
128 erlang-tools \
129 rebar
130
131RUN apt-get install -y --no-install-recommends \
132`# Haskell dependencies` \
133 ghc \
134 cabal-install \
135`# Haxe dependencies` \
136 neko \
137 neko-dev \
138 libneko0
139
140# Newer release of nodejs
141RUN curl -sL https://deb.nodesource.com/setup_4.x | bash
142RUN apt-get install -y --no-install-recommends \
143`# Node.js dependencies` \
144 nodejs
145
146# Add mono package repository url to get latest version of mono
147RUN echo "deb http://download.mono-project.com/repo/debian trusty main" | tee /etc/apt/sources.list.d/mono.list
148RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A6A19B38D3D831EF
149RUN apt-get update && apt-get install -y --no-install-recommends \
150`# CSharp dependencies` \
151 mono-devel
152
153RUN apt-get install -y --no-install-recommends \
154`# D dependencies` \
155 xdg-utils \
156`# Dart dependencies` \
157 dart \
158`# Lua dependencies` \
159 lua5.2 \
160 lua5.2-dev \
161`# MinGW dependencies` \
162 mingw32 \
163 mingw32-binutils \
164 mingw32-runtime \
165 nsis \
166`# Clean up` \
167 && rm -rf /var/cache/apt/* && \
168 rm -rf /var/lib/apt/lists/* && \
169 rm -rf /tmp/* && \
170 rm -rf /var/tmp/*
171
172# Ruby
173RUN gem install bundler --no-ri --no-rdoc
174
175# Python optional dependencies
176RUN pip2 install -U ipaddress backports.ssl_match_hostname tornado
177RUN pip3 install -U backports.ssl_match_hostname tornado
178
179# Go
180RUN curl -sSL https://storage.googleapis.com/golang/go1.4.3.linux-amd64.tar.gz | tar -C /usr/local/ -xz
181ENV PATH /usr/local/go/bin:$PATH
182
183# Haxe
184RUN mkdir -p /usr/lib/haxe && \
185 wget -O - https://github.com/HaxeFoundation/haxe/releases/download/3.2.1/haxe-3.2.1-linux64.tar.gz | \
186 tar -C /usr/lib/haxe --strip-components=1 -xz && \
187 ln -s /usr/lib/haxe/haxe /usr/bin/haxe && \
188 ln -s /usr/lib/haxe/haxelib /usr/bin/haxelib && \
189 mkdir -p /usr/lib/haxe/lib && \
190 chmod -R 777 /usr/lib/haxe/lib && \
191 haxelib setup --always /usr/lib/haxe/lib && \
192 haxelib install --always hxcpp 3.4.64
193
194# Node.js
195# temporarily removed since this breaks the build (and is not needed to test C# code)
196# RUN curl -sSL https://www.npmjs.com/install.sh | sh
197
198# D
199RUN 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 && \
200 dpkg -i /tmp/dmd_2.070.0-0_amd64.deb && \
201 rm /tmp/dmd_2.070.0-0_amd64.deb && \
202 curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
203 curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
204 mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
205 mv libevent-master/deimos/* openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
206 mv libevent-master/C/* openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
207 rm -rf libevent-master openssl-master && \
208 echo 'gcc -Wl,--no-as-needed $*' > /usr/local/bin/gcc-dmd && \
209 chmod 755 /usr/local/bin/gcc-dmd && \
210 echo 'CC=/usr/local/bin/gcc-dmd' >> /etc/dmd.conf
211
212# Dart
213ENV PATH /usr/lib/dart/bin:$PATH
214
215# OCaml
216RUN echo 'deb http://ppa.launchpad.net/avsm/ppa/ubuntu trusty main' > /etc/apt/sources.list.d/avsm-official-ocaml.list && \
217 gpg --keyserver keyserver.ubuntu.com --recv 61707B09 && \
218 gpg --export --armor 61707B09 | apt-key add - && \
219 apt-get update && \
220 apt-get install -y ocaml opam && \
221 opam init && \
222 opam install oasis
223
224# Rust
225RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.17.0
226ENV PATH /root/.cargo/bin:$PATH
227
228ENV THRIFT_ROOT /thrift
229RUN mkdir -p $THRIFT_ROOT/src
230COPY Dockerfile $THRIFT_ROOT/
231WORKDIR $THRIFT_ROOT/src