blob: 1c4373e4483c760835189335690ee960588f7835 [file] [log] [blame]
James E. King, IIIb66b66f2017-08-31 18:07:40 -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
James E. King, III0ad20bd2017-09-30 15:44:16 -070013#
James E. King, IIIb66b66f2017-08-31 18:07:40 -070014# Apache Thrift Docker build environment for Ubuntu Xenial
James E. King, III0ad20bd2017-09-30 15:44:16 -070015# Using all stock Ubuntu Xenial packaging except for:
James Lacey7054b312021-03-26 11:38:38 -070016# - d: does not come with Ubuntu so we're installing 2.087.0 for coverage
James E. King III93ff9b02019-06-21 17:50:34 -040017# - dart: does not come with Ubuntu so we're installing 2.0.0-1 for coverage
John Boiles57852792018-01-05 14:37:05 -080018# - dotnet: does not come with Ubuntu
James E. King III3b779822019-03-15 15:59:27 -040019# - go: Xenial comes with 1.6, but we need 1.10 or later
Mario Emmenlauer55680af2020-05-11 22:58:48 +020020# - nodejs: Xenial comes with 4.2.6 which exits LTS April 2018, so we're installing 10.x
James E. King IIIa02ae562018-03-12 15:27:23 -040021# - ocaml: causes stack overflow error, just started March 2018 not sure why
James E. King, III0ad20bd2017-09-30 15:44:16 -070022#
23
James E. King, IIIb66b66f2017-08-31 18:07:40 -070024FROM buildpack-deps:xenial-scm
25MAINTAINER Apache Thrift <dev@thrift.apache.org>
James E. King, IIIb66b66f2017-08-31 18:07:40 -070026ENV DEBIAN_FRONTEND noninteractive
27
James E. King, IIId7142b72017-09-01 13:00:36 -070028### Add apt repos
James E. King, IIIb66b66f2017-08-31 18:07:40 -070029
Robert Lu31d5b7b2018-01-05 13:44:38 +080030RUN 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 \
James E. King IIIad238522018-01-13 19:52:31 -050037 software-properties-common \
James E. King III93ff9b02019-06-21 17:50:34 -040038 wget && \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070039
James E. King, IIIb66b66f2017-08-31 18:07:40 -070040# Dart
James E. King III93ff9b02019-06-21 17:50:34 -040041 curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
Robert Lu31d5b7b2018-01-05 13:44:38 +080042 curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > \
James E. King III93ff9b02019-06-21 17:50:34 -040043 /etc/apt/sources.list.d/dart_stable.list && \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070044
James E. King, III6e883f92017-11-18 21:18:05 -050045# dotnet (core)
James E. King III93ff9b02019-06-21 17:50:34 -040046 curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \
Robert Lu31d5b7b2018-01-05 13:44:38 +080047 echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > \
James E. King III93ff9b02019-06-21 17:50:34 -040048 /etc/apt/sources.list.d/dotnetdev.list && \
James E. King, IIId7142b72017-09-01 13:00:36 -070049
James E. King IIIa37feaf2018-03-06 15:11:01 -050050# node.js
James E. King III93ff9b02019-06-21 17:50:34 -040051 curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
Mario Emmenlauer55680af2020-05-11 22:58:48 +020052 echo "deb https://deb.nodesource.com/node_10.x xenial main" | tee /etc/apt/sources.list.d/nodesource.list && \
Jano Svitok299b68e2020-03-09 23:07:30 +010053
54# ruby 2.4
55 apt-add-repository ppa:brightbox/ruby-ng
Brian Forbisb5d6ea32018-08-25 23:39:29 -040056
James E. King, IIId7142b72017-09-01 13:00:36 -070057### install general dependencies
James E. King, III0ad20bd2017-09-30 15:44:16 -070058RUN apt-get update && apt-get install -y --no-install-recommends \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070059`# General dependencies` \
James E. King, IIIf4543692017-09-01 05:23:29 -070060 bash-completion \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070061 bison \
62 build-essential \
63 clang \
64 cmake \
65 debhelper \
66 flex \
James E. King, IIId7142b72017-09-01 13:00:36 -070067 gdb \
68 llvm \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070069 ninja-build \
70 pkg-config \
James E. King, III7d211b82017-09-06 10:12:02 -070071 valgrind \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070072 vim
James E. King, IIId7142b72017-09-01 13:00:36 -070073ENV PATH /usr/lib/llvm-3.8/bin:$PATH
James E. King, IIIb66b66f2017-08-31 18:07:40 -070074
James E. King, IIId7142b72017-09-01 13:00:36 -070075### languages
James E. King, IIIb66b66f2017-08-31 18:07:40 -070076
77RUN apt-get install -y --no-install-recommends \
78`# C++ dependencies` \
79 libboost-dev \
80 libboost-filesystem-dev \
81 libboost-program-options-dev \
82 libboost-system-dev \
83 libboost-test-dev \
84 libboost-thread-dev \
85 libevent-dev \
86 libssl-dev \
87 qt5-default \
88 qtbase5-dev \
89 qtbase5-dev-tools
90
James Lacey7054b312021-03-26 11:38:38 -070091ENV D_VERSION 2.087.0
92ENV DMD_DEB dmd_2.087.0-0_amd64.deb
93RUN \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070094`# D dependencies` \
James Lacey7054b312021-03-26 11:38:38 -070095 wget -q http://downloads.dlang.org/releases/2.x/${D_VERSION}/${DMD_DEB} && \
96 dpkg --install ${DMD_DEB} && \
97 rm -f ${DMD_DEB} && \
98 mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
99 git clone -b 'v2.0.2+2.0.16' https://github.com/D-Programming-Deimos/libevent.git deimos-libevent-2.0 && \
100 mv deimos-libevent-2.0/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
101 mv deimos-libevent-2.0/C/* /usr/include/dmd/druntime/import/C/ && \
102 rm -rf deimos-libevent-2.0 && \
103 git clone -b 'v1.1.6+1.0.1g' https://github.com/D-Programming-Deimos/openssl.git deimos-openssl-1.0.1g && \
104 mv deimos-openssl-1.0.1g/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
105 mv deimos-openssl-1.0.1g/C/* /usr/include/dmd/druntime/import/C/ && \
106 rm -rf deimos-openssl-1.0.1g
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700107
aaronstgeorge-wf1ab156a2020-10-01 17:28:28 +0200108ENV DART_VERSION 2.7.2-1
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700109RUN apt-get install -y --no-install-recommends \
110`# Dart dependencies` \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700111 dart=$DART_VERSION
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700112ENV PATH /usr/lib/dart/bin:$PATH
113
James E. King, IIIb6287362017-09-28 11:57:42 +0000114RUN apt-get install -y --no-install-recommends \
115`# dotnet core dependencies` \
Jens Geyer526a1ac2021-02-13 13:58:09 +0100116 dotnet-sdk-5.0
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700117
118RUN apt-get install -y --no-install-recommends \
119`# Erlang dependencies` \
120 erlang-base \
121 erlang-eunit \
122 erlang-dev \
123 erlang-tools \
124 rebar
125
126RUN apt-get install -y --no-install-recommends \
127`# GlibC dependencies` \
128 libglib2.0-dev
129
John Boiles57852792018-01-05 14:37:05 -0800130# golang
Yuxuan 'fishy' Wangb71f11e2021-03-22 15:01:00 -0700131ENV GOLANG_VERSION 1.15.10
John Boiles57852792018-01-05 14:37:05 -0800132ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
Yuxuan 'fishy' Wangb71f11e2021-03-22 15:01:00 -0700133ENV GOLANG_DOWNLOAD_SHA256 4aa1267517df32f2bf1cc3d55dfc27d0c6b2c2b0989449c96dd19273ccca051d
John Boiles57852792018-01-05 14:37:05 -0800134RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \
135 echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \
136 tar -C /usr/local -xzf golang.tar.gz && \
137 ln -s /usr/local/go/bin/go /usr/local/bin && \
138 rm golang.tar.gz
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700139
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700140RUN apt-get install -y --no-install-recommends \
141`# Haxe dependencies` \
142 haxe \
143 neko \
144 neko-dev \
James E. King IIIad238522018-01-13 19:52:31 -0500145 libneko0 && \
146 haxelib setup --always /usr/share/haxe/lib && \
James E. King IIIf64a3fc2018-01-14 08:54:25 -0500147 haxelib install --always hxcpp 3.4.64 2>&1 > /dev/null
James E. King, III81cdcd32017-09-09 17:54:10 +0000148# note: hxcpp 3.4.185 (latest) no longer ships static libraries, and caused a build failure
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700149
150RUN apt-get install -y --no-install-recommends \
151`# Java dependencies` \
152 ant \
153 ant-optional \
154 openjdk-8-jdk \
155 maven
156
James E. King III93ff9b02019-06-21 17:50:34 -0400157# disabled: same as ubuntu-bionic jobs
158# RUN apt-get install -y --no-install-recommends \
159# `# Lua dependencies` \
160# lua5.2 \
161# lua5.2-dev
James E. King, IIId7142b72017-09-01 13:00:36 -0700162# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
163# lua5.3 does not install alternatives so stick with 5.2 here
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700164
165RUN apt-get install -y --no-install-recommends \
166`# Node.js dependencies` \
James E. King IIIa37feaf2018-03-06 15:11:01 -0500167 nodejs
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700168
Brian Forbisb5d6ea32018-08-25 23:39:29 -0400169# Test dependencies for running puppeteer
170RUN apt-get install -y --no-install-recommends \
171`# JS dependencies` \
172 libxss1 \
Yuxuan 'fishy' Wang0f735582021-04-28 08:33:36 -0700173 libxtst6 \
Brian Forbisb5d6ea32018-08-25 23:39:29 -0400174 libatk-bridge2.0-0 \
175 libgtk-3-0
176
James E. King IIIa02ae562018-03-12 15:27:23 -0400177# THRIFT-4517: causes stack overflows; version too old; skip ocaml in xenial
178# RUN apt-get install -y --no-install-recommends \
179# `# OCaml dependencies` \
180# ocaml \
181# opam && \
182# opam init --yes && \
183# opam install --yes oasis
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700184
185RUN apt-get install -y --no-install-recommends \
186`# Perl dependencies` \
187 libbit-vector-perl \
188 libclass-accessor-class-perl \
189 libcrypt-ssleay-perl \
190 libio-socket-ssl-perl \
Kengo Sekicb4c31a2019-12-26 14:34:57 +0900191 libnet-ssleay-perl \
192 libtest-exception-perl
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700193
194RUN apt-get install -y --no-install-recommends \
195`# Php dependencies` \
196 php7.0 \
197 php7.0-cli \
198 php7.0-dev \
James E. King IIIe53d23c2019-02-10 11:13:23 -0500199 php-json \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700200 php-pear \
201 re2c \
Robert Lua15060a2017-12-28 15:29:39 +0800202 composer
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700203
204RUN apt-get install -y --no-install-recommends \
205`# Python dependencies` \
206 python-all \
207 python-all-dbg \
208 python-all-dev \
209 python-backports.ssl-match-hostname \
210 python-ipaddress \
211 python-pip \
212 python-setuptools \
James E. King, IIId7142b72017-09-01 13:00:36 -0700213 python-six \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700214 python-tornado \
215 python-twisted \
James E. King, IIId7142b72017-09-01 13:00:36 -0700216 python-wheel \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700217 python-zope.interface \
218 python3-all \
219 python3-all-dbg \
220 python3-all-dev \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700221 python3-setuptools \
James E. King, IIId7142b72017-09-01 13:00:36 -0700222 python3-six \
223 python3-tornado \
224 python3-twisted \
225 python3-wheel \
226 python3-zope.interface && \
227 pip install --upgrade backports.ssl_match_hostname
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700228
229RUN apt-get install -y --no-install-recommends \
230`# Ruby dependencies` \
Jano Svitok299b68e2020-03-09 23:07:30 +0100231 ruby2.4 \
232 ruby2.4-dev \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700233 ruby-bundler
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700234
Danny Browning181d9002019-04-15 09:50:24 -0600235# Rust dependencies
Allen Georgeb0d14132020-03-29 11:48:55 -0400236RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.40.0 -y
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700237
ubuntu323f0322021-05-31 19:08:05 +0530238# Locale(s) for cpp unit tests
239RUN apt-get install -y --no-install-recommends \
240`# Locale dependencies` \
241 locales && \
242 locale-gen en_US.UTF-8 && \
243 update-locale
244
James E. King, IIId7142b72017-09-01 13:00:36 -0700245# Clean up
246RUN rm -rf /var/cache/apt/* && \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700247 rm -rf /var/lib/apt/lists/* && \
248 rm -rf /tmp/* && \
249 rm -rf /var/tmp/*
250
James E. King, IIIb6287362017-09-28 11:57:42 +0000251ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700252ENV THRIFT_ROOT /thrift
253RUN mkdir -p $THRIFT_ROOT/src
254COPY Dockerfile $THRIFT_ROOT/
255WORKDIR $THRIFT_ROOT/src