blob: 9a89b7007bf88e546ea0cbae99d7a9867f7b51a8 [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 Geyer4c7b9fd2021-12-04 22:48:37 +0100116 dotnet-sdk-6.0 \
117 dotnet-runtime-6.0 \
118 aspnetcore-runtime-6.0 \
119 dotnet-apphost-pack-6.0
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700120
121RUN apt-get install -y --no-install-recommends \
122`# Erlang dependencies` \
123 erlang-base \
124 erlang-eunit \
125 erlang-dev \
126 erlang-tools \
127 rebar
128
129RUN apt-get install -y --no-install-recommends \
130`# GlibC dependencies` \
131 libglib2.0-dev
132
John Boiles57852792018-01-05 14:37:05 -0800133# golang
Yuxuan 'fishy' Wanga2652362021-08-04 09:07:53 -0700134ENV GOLANG_VERSION 1.16.7
John Boiles57852792018-01-05 14:37:05 -0800135ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
Yuxuan 'fishy' Wanga2652362021-08-04 09:07:53 -0700136ENV GOLANG_DOWNLOAD_SHA256 7fe7a73f55ba3e2285da36f8b085e5c0159e9564ef5f63ee0ed6b818ade8ef04
John Boiles57852792018-01-05 14:37:05 -0800137RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \
138 echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \
139 tar -C /usr/local -xzf golang.tar.gz && \
140 ln -s /usr/local/go/bin/go /usr/local/bin && \
141 rm golang.tar.gz
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700142
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700143RUN apt-get install -y --no-install-recommends \
144`# Haxe dependencies` \
145 haxe \
146 neko \
147 neko-dev \
James E. King IIIad238522018-01-13 19:52:31 -0500148 libneko0 && \
149 haxelib setup --always /usr/share/haxe/lib && \
James E. King IIIf64a3fc2018-01-14 08:54:25 -0500150 haxelib install --always hxcpp 3.4.64 2>&1 > /dev/null
James E. King, III81cdcd32017-09-09 17:54:10 +0000151# 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 -0700152
153RUN apt-get install -y --no-install-recommends \
154`# Java dependencies` \
155 ant \
156 ant-optional \
157 openjdk-8-jdk \
158 maven
159
James E. King III93ff9b02019-06-21 17:50:34 -0400160# disabled: same as ubuntu-bionic jobs
161# RUN apt-get install -y --no-install-recommends \
162# `# Lua dependencies` \
163# lua5.2 \
164# lua5.2-dev
James E. King, IIId7142b72017-09-01 13:00:36 -0700165# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
166# lua5.3 does not install alternatives so stick with 5.2 here
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700167
168RUN apt-get install -y --no-install-recommends \
169`# Node.js dependencies` \
James E. King IIIa37feaf2018-03-06 15:11:01 -0500170 nodejs
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700171
Brian Forbisb5d6ea32018-08-25 23:39:29 -0400172# Test dependencies for running puppeteer
173RUN apt-get install -y --no-install-recommends \
174`# JS dependencies` \
175 libxss1 \
Yuxuan 'fishy' Wang0f735582021-04-28 08:33:36 -0700176 libxtst6 \
Brian Forbisb5d6ea32018-08-25 23:39:29 -0400177 libatk-bridge2.0-0 \
178 libgtk-3-0
179
James E. King IIIa02ae562018-03-12 15:27:23 -0400180# THRIFT-4517: causes stack overflows; version too old; skip ocaml in xenial
181# RUN apt-get install -y --no-install-recommends \
182# `# OCaml dependencies` \
183# ocaml \
184# opam && \
185# opam init --yes && \
186# opam install --yes oasis
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700187
188RUN apt-get install -y --no-install-recommends \
189`# Perl dependencies` \
190 libbit-vector-perl \
191 libclass-accessor-class-perl \
192 libcrypt-ssleay-perl \
193 libio-socket-ssl-perl \
Kengo Sekicb4c31a2019-12-26 14:34:57 +0900194 libnet-ssleay-perl \
195 libtest-exception-perl
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700196
197RUN apt-get install -y --no-install-recommends \
198`# Php dependencies` \
199 php7.0 \
200 php7.0-cli \
201 php7.0-dev \
James E. King IIIe53d23c2019-02-10 11:13:23 -0500202 php-json \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700203 php-pear \
204 re2c \
Robert Lua15060a2017-12-28 15:29:39 +0800205 composer
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700206
207RUN apt-get install -y --no-install-recommends \
208`# Python dependencies` \
209 python-all \
210 python-all-dbg \
211 python-all-dev \
212 python-backports.ssl-match-hostname \
213 python-ipaddress \
214 python-pip \
215 python-setuptools \
James E. King, IIId7142b72017-09-01 13:00:36 -0700216 python-six \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700217 python-tornado \
218 python-twisted \
James E. King, IIId7142b72017-09-01 13:00:36 -0700219 python-wheel \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700220 python-zope.interface \
221 python3-all \
222 python3-all-dbg \
223 python3-all-dev \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700224 python3-setuptools \
James E. King, IIId7142b72017-09-01 13:00:36 -0700225 python3-six \
226 python3-tornado \
227 python3-twisted \
228 python3-wheel \
229 python3-zope.interface && \
230 pip install --upgrade backports.ssl_match_hostname
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700231
232RUN apt-get install -y --no-install-recommends \
233`# Ruby dependencies` \
Jano Svitok299b68e2020-03-09 23:07:30 +0100234 ruby2.4 \
235 ruby2.4-dev \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700236 ruby-bundler
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700237
Danny Browning181d9002019-04-15 09:50:24 -0600238# Rust dependencies
Allen Georgeb0d14132020-03-29 11:48:55 -0400239RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.40.0 -y
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700240
ubuntu323f0322021-05-31 19:08:05 +0530241# Locale(s) for cpp unit tests
242RUN apt-get install -y --no-install-recommends \
243`# Locale dependencies` \
244 locales && \
245 locale-gen en_US.UTF-8 && \
ubuntuad76a182021-06-07 08:21:05 +0530246 locale-gen de_DE.UTF-8 && \
ubuntu323f0322021-05-31 19:08:05 +0530247 update-locale
248
James E. King, IIId7142b72017-09-01 13:00:36 -0700249# Clean up
250RUN rm -rf /var/cache/apt/* && \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700251 rm -rf /var/lib/apt/lists/* && \
252 rm -rf /tmp/* && \
253 rm -rf /var/tmp/*
254
James E. King, IIIb6287362017-09-28 11:57:42 +0000255ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700256ENV THRIFT_ROOT /thrift
257RUN mkdir -p $THRIFT_ROOT/src
258COPY Dockerfile $THRIFT_ROOT/
259WORKDIR $THRIFT_ROOT/src