blob: 1fe4c3d9a3b07b6372921f5ec445a8a1e486460f [file] [log] [blame]
James E. King IIIf5f430d2018-06-08 03:37:55 +00001# 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#
14# Apache Thrift Docker build environment for Ubuntu Bionic
15# Using all stock Ubuntu Bionic packaging except for:
James E. King IIIdabb5392018-07-07 02:48:43 +000016# - cl: want latest
James E. King IIIf5f430d2018-06-08 03:37:55 +000017# - d: dmd does not come with Ubuntu
18# - dart: does not come with Ubuntu
19# - dotnet: does not come with Ubuntu
20# - go: want latest
21# - nodejs: want v8, bionic comes with v6
James E. King IIIf5f430d2018-06-08 03:37:55 +000022#
23
24FROM buildpack-deps:bionic-scm
25MAINTAINER Apache Thrift <dev@thrift.apache.org>
26ENV DEBIAN_FRONTEND noninteractive
27
28### Add apt repos
29
30RUN apt-get update && \
31 apt-get dist-upgrade -y && \
32 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
40
41# csharp (mono) - if we ever want a later version
42# RUN echo "deb http://download.mono-project.com/repo/debian xenial main" | tee /etc/apt/sources.list.d/mono.list && \
43# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A6A19B38D3D831EF
44
45# Dart
46RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
47 curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > \
48 /etc/apt/sources.list.d/dart_stable.list
49
50# dotnet (netcore)
51RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \
52 wget -q -O /etc/apt/sources.list.d/microsoft-prod.list https://packages.microsoft.com/config/ubuntu/18.04/prod.list && \
53 chown root:root /etc/apt/trusted.gpg.d/microsoft.gpg && \
54 chown root:root /etc/apt/sources.list.d/microsoft-prod.list
55
56# node.js
57RUN curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
58 echo "deb https://deb.nodesource.com/node_8.x bionic main" | tee /etc/apt/sources.list.d/nodesource.list
59
60### install general dependencies
61RUN apt-get update && apt-get install -y --no-install-recommends \
62`# General dependencies` \
63 bash-completion \
64 bison \
65 build-essential \
66 clang \
67 cmake \
68 debhelper \
69 flex \
70 gdb \
71 llvm \
72 ninja-build \
73 pkg-config \
74 valgrind \
75 vim
76ENV PATH /usr/lib/llvm-6.0/bin:$PATH
77
James E. King IIIf5f430d2018-06-08 03:37:55 +000078RUN apt-get install -y --no-install-recommends \
79`# C++ dependencies` \
80 libboost-all-dev \
81 libevent-dev \
82 libssl-dev \
83 qt5-default \
84 qtbase5-dev \
85 qtbase5-dev-tools
86
87RUN apt-get install -y --no-install-recommends \
88`# csharp (mono) dependencies` \
89 mono-devel
90
James E. King IIIdabb5392018-07-07 02:48:43 +000091ENV SBCL_VERSION 1.4.9
James E. King IIIf5f430d2018-06-08 03:37:55 +000092RUN \
93`# Common Lisp (sbcl) dependencies` \
94 curl --version && \
95 curl -O -J -L https://kent.dl.sourceforge.net/project/sbcl/sbcl/${SBCL_VERSION}/sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2 && \
96 tar xjf sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2 && \
97 cd sbcl-${SBCL_VERSION}-x86-64-linux && \
98 ./install.sh && \
99 sbcl --version && \
100 cd .. && \
101 rm -rf sbcl*
102
James E. King IIIdabb5392018-07-07 02:48:43 +0000103ENV D_VERSION 2.081.0
104ENV DMD_DEB dmd_2.081.0-0_amd64.deb
James E. King IIIf5f430d2018-06-08 03:37:55 +0000105RUN \
106`# D dependencies` \
107 wget -q http://downloads.dlang.org/releases/2.x/${D_VERSION}/${DMD_DEB} && \
108 dpkg --install ${DMD_DEB} && \
109 rm -f ${DMD_DEB} && \
110 mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
111 curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
112 mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
113 mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \
114 rm -rf libevent-master && \
115 curl -sSL https://github.com/jeking3/openssl/archive/tls_method.tar.gz| tar xz && \
116 mv openssl-tls_method/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
117 mv openssl-tls_method/C/* /usr/include/dmd/druntime/import/C/ && \
118 rm -rf openssl-tls_method
119
120RUN apt-get install -y --no-install-recommends \
121 `# Dart dependencies` \
122 dart/stable
123ENV PATH /usr/lib/dart/bin:$PATH
124
125RUN apt-get install -y --no-install-recommends \
126`# dotnet core dependencies` \
127 dotnet-sdk-2.1
128
129RUN apt-get install -y --no-install-recommends \
130`# Erlang dependencies` \
131 erlang-base \
132 erlang-eunit \
133 erlang-dev \
134 erlang-tools \
135 rebar
136
137RUN apt-get install -y --no-install-recommends \
138`# GlibC dependencies` \
139 libglib2.0-dev
140
141# golang
James E. King IIIdabb5392018-07-07 02:48:43 +0000142ENV GOLANG_VERSION 1.10.3
James E. King IIIf5f430d2018-06-08 03:37:55 +0000143ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
James E. King IIIdabb5392018-07-07 02:48:43 +0000144ENV GOLANG_DOWNLOAD_SHA256 fa1b0e45d3b647c252f51f5e1204aba049cde4af177ef9f2181f43004f901035
James E. King IIIf5f430d2018-06-08 03:37:55 +0000145RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \
146 echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \
147 tar -C /usr/local -xzf golang.tar.gz && \
148 ln -s /usr/local/go/bin/go /usr/local/bin && \
149 rm golang.tar.gz
150
151RUN apt-get install -y --no-install-recommends \
152`# Haskell dependencies` \
153 ghc \
154 cabal-install
155
156RUN apt-get install -y --no-install-recommends \
157`# Haxe dependencies` \
158 haxe \
159 neko \
160 neko-dev && \
161 haxelib setup --always /usr/share/haxe/lib && \
162 haxelib install --always hxcpp 2>&1 > /dev/null
163
164RUN apt-get install -y --no-install-recommends \
165`# Java dependencies` \
166 ant \
167 ant-optional \
168 openjdk-8-jdk \
169 maven && \
170 update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
171
172RUN apt-get install -y --no-install-recommends \
173`# Lua dependencies` \
174 lua5.2 \
175 lua5.2-dev
176# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
177# lua5.3 does not install alternatives!
178# need to update our luasocket code, lua doesn't have luaL_openlib any more
179
180RUN apt-get install -y --no-install-recommends \
181`# Node.js dependencies` \
182 nodejs
183
184RUN apt-get install -y --no-install-recommends \
185`# OCaml dependencies` \
186 ocaml \
187 opam && \
188 opam init --yes && \
189 opam install --yes oasis
190
191RUN apt-get install -y --no-install-recommends \
192`# Perl dependencies` \
193 libbit-vector-perl \
194 libclass-accessor-class-perl \
195 libcrypt-ssleay-perl \
196 libio-socket-ssl-perl \
197 libnet-ssleay-perl
198
199RUN apt-get install -y --no-install-recommends \
200`# Php dependencies` \
201 php \
202 php-cli \
203 php-dev \
204 php-pear \
205 re2c \
206 composer
207
208RUN apt-get install -y --no-install-recommends \
209`# Python dependencies` \
210 python-all \
211 python-all-dbg \
212 python-all-dev \
213 python-ipaddress \
214 python-pip \
215 python-setuptools \
216 python-six \
217 python-tornado \
218 python-twisted \
219 python-wheel \
220 python-zope.interface && \
221 pip install --upgrade backports.ssl_match_hostname
222
223RUN apt-get install -y --no-install-recommends \
224`# Python3 dependencies` \
225 python3-all \
226 python3-all-dbg \
227 python3-all-dev \
228 python3-pip \
229 python3-setuptools \
230 python3-six \
231 python3-tornado \
232 python3-twisted \
233 python3-wheel \
234 python3-zope.interface
235
236RUN apt-get install -y --no-install-recommends \
237`# Ruby dependencies` \
238 ruby \
239 ruby-dev \
240 ruby-bundler
241
242RUN apt-get install -y --no-install-recommends \
243`# Rust dependencies` \
244 cargo \
245 rustc
246
247# cppcheck-1.82 has a nasty cpp parser bug, so we're using something newer
248RUN apt-get install -y --no-install-recommends \
249`# Static Code Analysis dependencies` \
250 cppcheck \
251 sloccount && \
252 pip install flake8 && \
253 wget -q "https://launchpad.net/ubuntu/+source/cppcheck/1.83-2/+build/14874703/+files/cppcheck_1.83-2_amd64.deb" && \
254 dpkg -i cppcheck_1.83-2_amd64.deb && \
255 rm cppcheck_1.83-2_amd64.deb
256
257# Clean up
258RUN rm -rf /var/cache/apt/* && \
259 rm -rf /var/lib/apt/lists/* && \
260 rm -rf /tmp/* && \
261 rm -rf /var/tmp/*
262
263ENV THRIFT_ROOT /thrift
264RUN mkdir -p $THRIFT_ROOT/src
265COPY Dockerfile $THRIFT_ROOT/
266WORKDIR $THRIFT_ROOT/src