blob: d1f58d6cc1fd1d76c940bad276225b6889a45238 [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#
14# Apache Thrift Docker build environment for Ubuntu Artful
15# Using all stock Ubuntu Artful packaging except for:
16# - cpp: stock boost 1.62 in artful has a nasty bug so we use stock boost 1.63
James E. King IIId907cc92018-01-12 10:43:25 -050017# - 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 IIId907cc92018-01-12 10:43:25 -050019# - dotnet: does not come with Ubuntu
20# - haxe: version 3.4.2 that comes with Ubuntu cores in our CI build
Aki Sukegawab03d7492018-06-08 11:39:34 +090021# - go: artful comes with 1.9, we want the latest (supported)
22# - nodejs: want v8, artful comes with v6
James E. King IIIa37feaf2018-03-06 15:11:01 -050023#
James E. King, III0ad20bd2017-09-30 15:44:16 -070024
25FROM buildpack-deps:artful-scm
26MAINTAINER Apache Thrift <dev@thrift.apache.org>
27ENV DEBIAN_FRONTEND noninteractive
28
Robert Lu31d5b7b2018-01-05 13:44:38 +080029### Add apt repos
30
Robert Lua15060a2017-12-28 15:29:39 +080031RUN apt-get update && \
32 apt-get dist-upgrade -y && \
James E. King, III0ad20bd2017-09-30 15:44:16 -070033 apt-get install -y --no-install-recommends \
34 apt \
35 apt-transport-https \
36 apt-utils \
37 curl \
38 dirmngr \
39 software-properties-common \
40 wget
41
Robert Lu31d5b7b2018-01-05 13:44:38 +080042# Dart
43RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
44 curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > \
45 /etc/apt/sources.list.d/dart_stable.list
Brian Forbisc64389a2018-09-22 07:36:24 -040046ENV DART_VERSION 1.24.3-1
James E. King, III0ad20bd2017-09-30 15:44:16 -070047
James E. King IIId907cc92018-01-12 10:43:25 -050048# dotnet (netcore)
49RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \
50 echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-artful-prod artful main" > \
51 /etc/apt/sources.list.d/dotnetdev.list
52
53# haxe (https://haxe.org/download/linux/)
54RUN add-apt-repository ppa:haxe/releases -y
55
56# node.js
James E. King III78755f52018-03-06 09:50:33 -050057RUN curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
James E. King IIId907cc92018-01-12 10:43:25 -050058 echo "deb https://deb.nodesource.com/node_8.x artful main" | tee /etc/apt/sources.list.d/nodesource.list
59
James E. King, III0ad20bd2017-09-30 15:44:16 -070060### install general dependencies
Robert Lu31d5b7b2018-01-05 13:44:38 +080061RUN apt-get update && apt-get install -y --no-install-recommends \
James E. King, III0ad20bd2017-09-30 15:44:16 -070062`# 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-3.8/bin:$PATH
77
78# boost-1.62 has a terrible bug in boost::test, see https://svn.boost.org/trac10/ticket/12507
79RUN apt-get install -y --no-install-recommends \
80`# C++ dependencies` \
81 libboost1.63-all-dev \
82 libevent-dev \
83 libssl-dev \
84 qt5-default \
85 qtbase5-dev \
86 qtbase5-dev-tools
87
Aki Sukegawab03d7492018-06-08 11:39:34 +090088ENV D_VERSION 2.080.0
89ENV DMD_DEB dmd_2.080.0-0_amd64.deb
James E. King IIIbf7f76b2018-02-28 17:11:05 -050090RUN \
91`# D dependencies` \
92 wget -q http://downloads.dlang.org/releases/2.x/${D_VERSION}/${DMD_DEB} && \
93 dpkg --install ${DMD_DEB} && \
94 rm -f ${DMD_DEB} && \
95 mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
James E. King IIIf338d572018-01-29 14:51:24 -050096 curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
97 mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
98 mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \
James E. King IIIbf7f76b2018-02-28 17:11:05 -050099 rm -rf libevent-master && \
100 curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
James E. King IIIf338d572018-01-29 14:51:24 -0500101 mv openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
102 mv openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
103 rm -rf openssl-master
James E. King, III0ad20bd2017-09-30 15:44:16 -0700104
Robert Lu31d5b7b2018-01-05 13:44:38 +0800105RUN apt-get install -y --no-install-recommends \
Mario Emmenlauer96ed7272021-08-30 10:54:39 +0200106`# Dart dependencies` \
Brian Forbisc64389a2018-09-22 07:36:24 -0400107 dart=$DART_VERSION
James E. King, III6e883f92017-11-18 21:18:05 -0500108ENV PATH /usr/lib/dart/bin:$PATH
James E. King, III0ad20bd2017-09-30 15:44:16 -0700109
James E. King, III6e883f92017-11-18 21:18:05 -0500110RUN apt-get install -y --no-install-recommends \
111`# dotnet core dependencies` \
Jens Geyer4c7b9fd2021-12-04 22:48:37 +0100112 dotnet-sdk-6.0 \
113 dotnet-runtime-6.0 \
114 aspnetcore-runtime-6.0 \
115 dotnet-apphost-pack-6.0
James E. King, III0ad20bd2017-09-30 15:44:16 -0700116
117RUN apt-get install -y --no-install-recommends \
118`# Erlang dependencies` \
119 erlang-base \
120 erlang-eunit \
121 erlang-dev \
122 erlang-tools \
123 rebar
124
125RUN apt-get install -y --no-install-recommends \
126`# GlibC dependencies` \
127 libglib2.0-dev
128
John Boiles57852792018-01-05 14:37:05 -0800129# golang
D. Can Celasuna9efd1a2018-03-15 12:52:37 +0100130ENV GOLANG_VERSION 1.10
John Boiles57852792018-01-05 14:37:05 -0800131ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
D. Can Celasuna9efd1a2018-03-15 12:52:37 +0100132ENV GOLANG_DOWNLOAD_SHA256 b5a64335f1490277b585832d1f6c7f8c6c11206cba5cd3f771dcb87b98ad1a33
John Boiles57852792018-01-05 14:37:05 -0800133RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \
134 echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \
135 tar -C /usr/local -xzf golang.tar.gz && \
136 ln -s /usr/local/go/bin/go /usr/local/bin && \
137 rm golang.tar.gz
James E. King, III0ad20bd2017-09-30 15:44:16 -0700138
139RUN apt-get install -y --no-install-recommends \
James E. King IIId907cc92018-01-12 10:43:25 -0500140`# Haxe dependencies` \
141 haxe \
142 neko \
143 neko-dev && \
144 haxelib setup --always /usr/share/haxe/lib && \
145 haxelib install --always hxcpp 2>&1 > /dev/null
James E. King, III0ad20bd2017-09-30 15:44:16 -0700146
147RUN apt-get install -y --no-install-recommends \
148`# Java dependencies` \
149 ant \
150 ant-optional \
151 openjdk-8-jdk \
152 maven
153
154RUN apt-get install -y --no-install-recommends \
155`# Lua dependencies` \
James E. King, III39eaae62017-11-19 20:17:33 -0500156 lua5.2 \
157 lua5.2-dev
James E. King, III0ad20bd2017-09-30 15:44:16 -0700158# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
159# lua5.3 does not install alternatives!
James E. King, III39eaae62017-11-19 20:17:33 -0500160# need to update our luasocket code, lua doesn't have luaL_openlib any more
James E. King, III0ad20bd2017-09-30 15:44:16 -0700161
162RUN apt-get install -y --no-install-recommends \
163`# Node.js dependencies` \
James E. King, III619218c2017-10-29 06:55:00 -0400164 nodejs
James E. King, III0ad20bd2017-09-30 15:44:16 -0700165
Brian Forbisb5d6ea32018-08-25 23:39:29 -0400166# Test dependencies for running puppeteer
167RUN apt-get install -y --no-install-recommends \
168`# JS dependencies` \
169 libxss1
170
James E. King, III0ad20bd2017-09-30 15:44:16 -0700171RUN apt-get install -y --no-install-recommends \
172`# OCaml dependencies` \
173 ocaml \
174 opam && \
175 opam init --yes && \
176 opam install --yes oasis
177
178RUN apt-get install -y --no-install-recommends \
179`# Perl dependencies` \
180 libbit-vector-perl \
181 libclass-accessor-class-perl \
182 libcrypt-ssleay-perl \
183 libio-socket-ssl-perl \
184 libnet-ssleay-perl
185
186RUN apt-get install -y --no-install-recommends \
187`# Php dependencies` \
188 php \
189 php-cli \
190 php-dev \
191 php-pear \
192 re2c \
Robert Lua15060a2017-12-28 15:29:39 +0800193 composer
James E. King, III0ad20bd2017-09-30 15:44:16 -0700194
195RUN apt-get install -y --no-install-recommends \
196`# Python dependencies` \
197 python-all \
198 python-all-dbg \
199 python-all-dev \
200 python-ipaddress \
201 python-pip \
202 python-setuptools \
203 python-six \
204 python-tornado \
205 python-twisted \
206 python-wheel \
207 python-zope.interface && \
208 pip install --upgrade backports.ssl_match_hostname
209
210RUN apt-get install -y --no-install-recommends \
211`# Python3 dependencies` \
212 python3-all \
213 python3-all-dbg \
214 python3-all-dev \
215 python3-pip \
216 python3-setuptools \
217 python3-six \
218 python3-tornado \
219 python3-twisted \
220 python3-wheel \
221 python3-zope.interface
222
223RUN apt-get install -y --no-install-recommends \
224`# Ruby dependencies` \
225 ruby \
226 ruby-dev \
227 ruby-bundler
James E. King, III0ad20bd2017-09-30 15:44:16 -0700228
229RUN apt-get install -y --no-install-recommends \
230`# Rust dependencies` \
231 cargo \
232 rustc
233
234RUN apt-get install -y --no-install-recommends \
235`# Static Code Analysis dependencies` \
236 cppcheck \
237 sloccount && \
238 pip install flake8
239
240# Clean up
241RUN rm -rf /var/cache/apt/* && \
242 rm -rf /var/lib/apt/lists/* && \
243 rm -rf /tmp/* && \
244 rm -rf /var/tmp/*
245
246ENV THRIFT_ROOT /thrift
247RUN mkdir -p $THRIFT_ROOT/src
248COPY Dockerfile $THRIFT_ROOT/
249WORKDIR $THRIFT_ROOT/src