blob: a8c1417ac9ffdfa7f691699b1fd0d4c22ece3445 [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
Brian Forbisc64389a2018-09-22 07:36:24 -040018# - dart: does not come with Ubuntu. Pinned to last 1.x release
James E. King IIIf5f430d2018-06-08 03:37:55 +000019# - 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
Brian Forbisc64389a2018-09-22 07:36:24 -040049ENV DART_VERSION 1.24.3-1
James E. King IIIf5f430d2018-06-08 03:37:55 +000050
51# dotnet (netcore)
52RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \
53 wget -q -O /etc/apt/sources.list.d/microsoft-prod.list https://packages.microsoft.com/config/ubuntu/18.04/prod.list && \
54 chown root:root /etc/apt/trusted.gpg.d/microsoft.gpg && \
55 chown root:root /etc/apt/sources.list.d/microsoft-prod.list
56
57# node.js
58RUN curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
59 echo "deb https://deb.nodesource.com/node_8.x bionic main" | tee /etc/apt/sources.list.d/nodesource.list
60
61### install general dependencies
62RUN apt-get update && apt-get install -y --no-install-recommends \
63`# General dependencies` \
64 bash-completion \
65 bison \
66 build-essential \
67 clang \
68 cmake \
69 debhelper \
70 flex \
71 gdb \
72 llvm \
73 ninja-build \
74 pkg-config \
75 valgrind \
76 vim
77ENV PATH /usr/lib/llvm-6.0/bin:$PATH
78
James E. King IIIf5f430d2018-06-08 03:37:55 +000079RUN apt-get install -y --no-install-recommends \
80`# C++ dependencies` \
81 libboost-all-dev \
82 libevent-dev \
83 libssl-dev \
84 qt5-default \
85 qtbase5-dev \
86 qtbase5-dev-tools
87
88RUN apt-get install -y --no-install-recommends \
89`# csharp (mono) dependencies` \
90 mono-devel
91
James E. King IIIcd829a02018-10-18 18:20:58 +000092ENV SBCL_VERSION 1.4.12
James E. King IIIf5f430d2018-06-08 03:37:55 +000093RUN \
94`# Common Lisp (sbcl) dependencies` \
95 curl --version && \
96 curl -O -J -L https://kent.dl.sourceforge.net/project/sbcl/sbcl/${SBCL_VERSION}/sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2 && \
97 tar xjf sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2 && \
98 cd sbcl-${SBCL_VERSION}-x86-64-linux && \
99 ./install.sh && \
100 sbcl --version && \
101 cd .. && \
102 rm -rf sbcl*
103
James E. King IIIcd829a02018-10-18 18:20:58 +0000104ENV D_VERSION 2.082.1
105ENV DMD_DEB dmd_2.082.1-0_amd64.deb
James E. King IIIf5f430d2018-06-08 03:37:55 +0000106RUN \
107`# D dependencies` \
108 wget -q http://downloads.dlang.org/releases/2.x/${D_VERSION}/${DMD_DEB} && \
109 dpkg --install ${DMD_DEB} && \
110 rm -f ${DMD_DEB} && \
111 mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
112 curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
113 mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
114 mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \
115 rm -rf libevent-master && \
116 curl -sSL https://github.com/jeking3/openssl/archive/tls_method.tar.gz| tar xz && \
117 mv openssl-tls_method/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
118 mv openssl-tls_method/C/* /usr/include/dmd/druntime/import/C/ && \
119 rm -rf openssl-tls_method
120
121RUN apt-get install -y --no-install-recommends \
122 `# Dart dependencies` \
Brian Forbisc64389a2018-09-22 07:36:24 -0400123 dart=$DART_VERSION
James E. King IIIf5f430d2018-06-08 03:37:55 +0000124ENV PATH /usr/lib/dart/bin:$PATH
125
126RUN apt-get install -y --no-install-recommends \
127`# dotnet core dependencies` \
128 dotnet-sdk-2.1
129
130RUN apt-get install -y --no-install-recommends \
131`# Erlang dependencies` \
132 erlang-base \
133 erlang-eunit \
134 erlang-dev \
135 erlang-tools \
136 rebar
137
138RUN apt-get install -y --no-install-recommends \
139`# GlibC dependencies` \
140 libglib2.0-dev
141
142# golang
James E. King IIIcd829a02018-10-18 18:20:58 +0000143ENV GOLANG_VERSION 1.11.1
James E. King IIIf5f430d2018-06-08 03:37:55 +0000144ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
James E. King IIIcd829a02018-10-18 18:20:58 +0000145ENV GOLANG_DOWNLOAD_SHA256 2871270d8ff0c8c69f161aaae42f9f28739855ff5c5204752a8d92a1c9f63993
James E. King IIIf5f430d2018-06-08 03:37:55 +0000146RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \
147 echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \
148 tar -C /usr/local -xzf golang.tar.gz && \
149 ln -s /usr/local/go/bin/go /usr/local/bin && \
150 rm golang.tar.gz
151
152RUN apt-get install -y --no-install-recommends \
153`# Haskell dependencies` \
154 ghc \
155 cabal-install
156
157RUN apt-get install -y --no-install-recommends \
158`# Haxe dependencies` \
159 haxe \
160 neko \
161 neko-dev && \
162 haxelib setup --always /usr/share/haxe/lib && \
163 haxelib install --always hxcpp 2>&1 > /dev/null
164
165RUN apt-get install -y --no-install-recommends \
166`# Java dependencies` \
167 ant \
168 ant-optional \
169 openjdk-8-jdk \
170 maven && \
171 update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
172
173RUN apt-get install -y --no-install-recommends \
174`# Lua dependencies` \
175 lua5.2 \
176 lua5.2-dev
177# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
178# lua5.3 does not install alternatives!
179# need to update our luasocket code, lua doesn't have luaL_openlib any more
180
181RUN apt-get install -y --no-install-recommends \
182`# Node.js dependencies` \
183 nodejs
184
Brian Forbisb5d6ea32018-08-25 23:39:29 -0400185# Test dependencies for running puppeteer
186RUN apt-get install -y --no-install-recommends \
187`# JS dependencies` \
188 libxss1
189
James E. King IIIf5f430d2018-06-08 03:37:55 +0000190RUN apt-get install -y --no-install-recommends \
191`# OCaml dependencies` \
192 ocaml \
193 opam && \
194 opam init --yes && \
195 opam install --yes oasis
196
197RUN apt-get install -y --no-install-recommends \
198`# Perl dependencies` \
199 libbit-vector-perl \
200 libclass-accessor-class-perl \
201 libcrypt-ssleay-perl \
202 libio-socket-ssl-perl \
203 libnet-ssleay-perl
204
205RUN apt-get install -y --no-install-recommends \
206`# Php dependencies` \
207 php \
208 php-cli \
209 php-dev \
210 php-pear \
211 re2c \
212 composer
213
214RUN apt-get install -y --no-install-recommends \
215`# Python dependencies` \
216 python-all \
217 python-all-dbg \
218 python-all-dev \
219 python-ipaddress \
220 python-pip \
221 python-setuptools \
222 python-six \
223 python-tornado \
224 python-twisted \
225 python-wheel \
226 python-zope.interface && \
227 pip install --upgrade backports.ssl_match_hostname
228
229RUN apt-get install -y --no-install-recommends \
230`# Python3 dependencies` \
231 python3-all \
232 python3-all-dbg \
233 python3-all-dev \
234 python3-pip \
235 python3-setuptools \
236 python3-six \
237 python3-tornado \
238 python3-twisted \
239 python3-wheel \
240 python3-zope.interface
241
242RUN apt-get install -y --no-install-recommends \
243`# Ruby dependencies` \
244 ruby \
245 ruby-dev \
246 ruby-bundler
247
248RUN apt-get install -y --no-install-recommends \
249`# Rust dependencies` \
250 cargo \
251 rustc
252
253# cppcheck-1.82 has a nasty cpp parser bug, so we're using something newer
254RUN apt-get install -y --no-install-recommends \
255`# Static Code Analysis dependencies` \
256 cppcheck \
257 sloccount && \
258 pip install flake8 && \
259 wget -q "https://launchpad.net/ubuntu/+source/cppcheck/1.83-2/+build/14874703/+files/cppcheck_1.83-2_amd64.deb" && \
260 dpkg -i cppcheck_1.83-2_amd64.deb && \
261 rm cppcheck_1.83-2_amd64.deb
262
263# Clean up
264RUN rm -rf /var/cache/apt/* && \
265 rm -rf /var/lib/apt/lists/* && \
266 rm -rf /tmp/* && \
267 rm -rf /var/tmp/*
268
269ENV THRIFT_ROOT /thrift
270RUN mkdir -p $THRIFT_ROOT/src
271COPY Dockerfile $THRIFT_ROOT/
272WORKDIR $THRIFT_ROOT/src