blob: aef35c558c5ca6114e949f488cd84543e727dc0b [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 \
James E. King III52da9ab2019-01-22 20:16:39 +010075 unzip \
James E. King IIIf5f430d2018-06-08 03:37:55 +000076 valgrind \
77 vim
78ENV PATH /usr/lib/llvm-6.0/bin:$PATH
79
James E. King III52da9ab2019-01-22 20:16:39 +010080# lib/as3 (ActionScript)
81RUN mkdir -p /usr/local/adobe/flex/4.6 && \
82 cd /usr/local/adobe/flex/4.6 && \
83 wget -q "http://download.macromedia.com/pub/flex/sdk/flex_sdk_4.6.zip" && \
84 unzip flex_sdk_4.6.zip
85ENV FLEX_HOME /usr/local/adobe/flex/4.6
86
James E. King IIIf5f430d2018-06-08 03:37:55 +000087RUN apt-get install -y --no-install-recommends \
88`# C++ dependencies` \
89 libboost-all-dev \
90 libevent-dev \
91 libssl-dev \
92 qt5-default \
93 qtbase5-dev \
94 qtbase5-dev-tools
95
96RUN apt-get install -y --no-install-recommends \
97`# csharp (mono) dependencies` \
98 mono-devel
99
James E. King IIIcd829a02018-10-18 18:20:58 +0000100ENV SBCL_VERSION 1.4.12
James E. King IIIf5f430d2018-06-08 03:37:55 +0000101RUN \
102`# Common Lisp (sbcl) dependencies` \
103 curl --version && \
104 curl -O -J -L https://kent.dl.sourceforge.net/project/sbcl/sbcl/${SBCL_VERSION}/sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2 && \
105 tar xjf sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2 && \
106 cd sbcl-${SBCL_VERSION}-x86-64-linux && \
107 ./install.sh && \
108 sbcl --version && \
109 cd .. && \
110 rm -rf sbcl*
111
James E. King IIIcd829a02018-10-18 18:20:58 +0000112ENV D_VERSION 2.082.1
113ENV DMD_DEB dmd_2.082.1-0_amd64.deb
James E. King IIIf5f430d2018-06-08 03:37:55 +0000114RUN \
115`# D dependencies` \
116 wget -q http://downloads.dlang.org/releases/2.x/${D_VERSION}/${DMD_DEB} && \
117 dpkg --install ${DMD_DEB} && \
118 rm -f ${DMD_DEB} && \
119 mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
120 curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
121 mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
122 mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \
123 rm -rf libevent-master && \
124 curl -sSL https://github.com/jeking3/openssl/archive/tls_method.tar.gz| tar xz && \
125 mv openssl-tls_method/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
126 mv openssl-tls_method/C/* /usr/include/dmd/druntime/import/C/ && \
127 rm -rf openssl-tls_method
128
129RUN apt-get install -y --no-install-recommends \
130 `# Dart dependencies` \
Brian Forbisc64389a2018-09-22 07:36:24 -0400131 dart=$DART_VERSION
James E. King IIIf5f430d2018-06-08 03:37:55 +0000132ENV PATH /usr/lib/dart/bin:$PATH
133
134RUN apt-get install -y --no-install-recommends \
135`# dotnet core dependencies` \
136 dotnet-sdk-2.1
137
138RUN apt-get install -y --no-install-recommends \
139`# Erlang dependencies` \
140 erlang-base \
141 erlang-eunit \
142 erlang-dev \
143 erlang-tools \
144 rebar
145
146RUN apt-get install -y --no-install-recommends \
147`# GlibC dependencies` \
148 libglib2.0-dev
149
150# golang
James E. King IIIcd829a02018-10-18 18:20:58 +0000151ENV GOLANG_VERSION 1.11.1
James E. King IIIf5f430d2018-06-08 03:37:55 +0000152ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
James E. King IIIcd829a02018-10-18 18:20:58 +0000153ENV GOLANG_DOWNLOAD_SHA256 2871270d8ff0c8c69f161aaae42f9f28739855ff5c5204752a8d92a1c9f63993
James E. King IIIf5f430d2018-06-08 03:37:55 +0000154RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \
155 echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \
156 tar -C /usr/local -xzf golang.tar.gz && \
157 ln -s /usr/local/go/bin/go /usr/local/bin && \
158 rm golang.tar.gz
159
160RUN apt-get install -y --no-install-recommends \
161`# Haskell dependencies` \
162 ghc \
163 cabal-install
164
165RUN apt-get install -y --no-install-recommends \
166`# Haxe dependencies` \
167 haxe \
168 neko \
169 neko-dev && \
170 haxelib setup --always /usr/share/haxe/lib && \
171 haxelib install --always hxcpp 2>&1 > /dev/null
172
173RUN apt-get install -y --no-install-recommends \
174`# Java dependencies` \
175 ant \
176 ant-optional \
177 openjdk-8-jdk \
178 maven && \
179 update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
180
181RUN apt-get install -y --no-install-recommends \
182`# Lua dependencies` \
183 lua5.2 \
184 lua5.2-dev
185# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
186# lua5.3 does not install alternatives!
187# need to update our luasocket code, lua doesn't have luaL_openlib any more
188
189RUN apt-get install -y --no-install-recommends \
190`# Node.js dependencies` \
191 nodejs
192
Brian Forbisb5d6ea32018-08-25 23:39:29 -0400193# Test dependencies for running puppeteer
194RUN apt-get install -y --no-install-recommends \
195`# JS dependencies` \
196 libxss1
197
James E. King IIIf5f430d2018-06-08 03:37:55 +0000198RUN apt-get install -y --no-install-recommends \
199`# OCaml dependencies` \
200 ocaml \
201 opam && \
202 opam init --yes && \
203 opam install --yes oasis
204
205RUN apt-get install -y --no-install-recommends \
206`# Perl dependencies` \
207 libbit-vector-perl \
208 libclass-accessor-class-perl \
209 libcrypt-ssleay-perl \
210 libio-socket-ssl-perl \
211 libnet-ssleay-perl
212
213RUN apt-get install -y --no-install-recommends \
214`# Php dependencies` \
215 php \
216 php-cli \
217 php-dev \
218 php-pear \
219 re2c \
220 composer
221
222RUN apt-get install -y --no-install-recommends \
223`# Python dependencies` \
224 python-all \
225 python-all-dbg \
226 python-all-dev \
227 python-ipaddress \
228 python-pip \
229 python-setuptools \
230 python-six \
231 python-tornado \
232 python-twisted \
233 python-wheel \
234 python-zope.interface && \
235 pip install --upgrade backports.ssl_match_hostname
236
237RUN apt-get install -y --no-install-recommends \
238`# Python3 dependencies` \
239 python3-all \
240 python3-all-dbg \
241 python3-all-dev \
242 python3-pip \
243 python3-setuptools \
244 python3-six \
245 python3-tornado \
246 python3-twisted \
247 python3-wheel \
248 python3-zope.interface
249
250RUN apt-get install -y --no-install-recommends \
251`# Ruby dependencies` \
252 ruby \
253 ruby-dev \
254 ruby-bundler
255
256RUN apt-get install -y --no-install-recommends \
257`# Rust dependencies` \
258 cargo \
259 rustc
260
261# cppcheck-1.82 has a nasty cpp parser bug, so we're using something newer
262RUN apt-get install -y --no-install-recommends \
263`# Static Code Analysis dependencies` \
264 cppcheck \
265 sloccount && \
266 pip install flake8 && \
267 wget -q "https://launchpad.net/ubuntu/+source/cppcheck/1.83-2/+build/14874703/+files/cppcheck_1.83-2_amd64.deb" && \
268 dpkg -i cppcheck_1.83-2_amd64.deb && \
269 rm cppcheck_1.83-2_amd64.deb
270
271# Clean up
272RUN rm -rf /var/cache/apt/* && \
273 rm -rf /var/lib/apt/lists/* && \
274 rm -rf /tmp/* && \
275 rm -rf /var/tmp/*
276
277ENV THRIFT_ROOT /thrift
278RUN mkdir -p $THRIFT_ROOT/src
279COPY Dockerfile $THRIFT_ROOT/
280WORKDIR $THRIFT_ROOT/src