blob: 1428fac00463cddce88c1137db55c9dba0a02252 [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
Aki Sukegawa7594da82022-03-07 00:28:26 -050077# TODO: "apt-get install" without "apt-get update" in the same "RUN" step can cause cache issues if modified later.
78# See https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#run
James E. King, IIIb66b66f2017-08-31 18:07:40 -070079RUN apt-get install -y --no-install-recommends \
80`# C++ dependencies` \
81 libboost-dev \
82 libboost-filesystem-dev \
83 libboost-program-options-dev \
84 libboost-system-dev \
85 libboost-test-dev \
86 libboost-thread-dev \
87 libevent-dev \
88 libssl-dev \
89 qt5-default \
90 qtbase5-dev \
91 qtbase5-dev-tools
92
James Lacey7054b312021-03-26 11:38:38 -070093ENV D_VERSION 2.087.0
94ENV DMD_DEB dmd_2.087.0-0_amd64.deb
95RUN \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070096`# D dependencies` \
James Lacey7054b312021-03-26 11:38:38 -070097 wget -q http://downloads.dlang.org/releases/2.x/${D_VERSION}/${DMD_DEB} && \
98 dpkg --install ${DMD_DEB} && \
99 rm -f ${DMD_DEB} && \
100 mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
101 git clone -b 'v2.0.2+2.0.16' https://github.com/D-Programming-Deimos/libevent.git deimos-libevent-2.0 && \
102 mv deimos-libevent-2.0/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
103 mv deimos-libevent-2.0/C/* /usr/include/dmd/druntime/import/C/ && \
104 rm -rf deimos-libevent-2.0 && \
105 git clone -b 'v1.1.6+1.0.1g' https://github.com/D-Programming-Deimos/openssl.git deimos-openssl-1.0.1g && \
106 mv deimos-openssl-1.0.1g/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
107 mv deimos-openssl-1.0.1g/C/* /usr/include/dmd/druntime/import/C/ && \
108 rm -rf deimos-openssl-1.0.1g
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700109
aaronstgeorge-wf1ab156a2020-10-01 17:28:28 +0200110ENV DART_VERSION 2.7.2-1
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700111RUN apt-get install -y --no-install-recommends \
112`# Dart dependencies` \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700113 dart=$DART_VERSION
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700114ENV PATH /usr/lib/dart/bin:$PATH
115
James E. King, IIIb6287362017-09-28 11:57:42 +0000116RUN apt-get install -y --no-install-recommends \
117`# dotnet core dependencies` \
Jens Geyer4c7b9fd2021-12-04 22:48:37 +0100118 dotnet-sdk-6.0 \
119 dotnet-runtime-6.0 \
120 aspnetcore-runtime-6.0 \
121 dotnet-apphost-pack-6.0
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700122
Aki Sukegawa7594da82022-03-07 00:28:26 -0500123# Erlang dependencies
124ARG ERLANG_OTP_VERSION=18.3.4.11
125ARG ERLANG_REBAR_VERSION=3.13.2
126RUN apt-get update && apt-get install -y --no-install-recommends automake libncurses5-dev && \
127 curl https://raw.githubusercontent.com/kerl/kerl/master/kerl -o /usr/local/bin/kerl && chmod +x /usr/local/bin/kerl && \
128 kerl build $ERLANG_OTP_VERSION && kerl install $ERLANG_OTP_VERSION /usr/local/lib/otp/ && . /usr/local/lib/otp/activate && \
129 curl https://s3.amazonaws.com/rebar3/rebar3 -o /usr/local/bin/rebar3 && chmod +x /usr/local/bin/rebar3 && \
130 curl -ssLo /usr/local/bin/rebar3 https://github.com/erlang/rebar3/releases/download/${ERLANG_REBAR_VERSION}/rebar3 && chmod +x /usr/local/bin/rebar3 && \
131 rebar3 --version
132ENV PATH /usr/local/lib/otp/bin:$PATH
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700133
134RUN apt-get install -y --no-install-recommends \
135`# GlibC dependencies` \
136 libglib2.0-dev
137
John Boiles57852792018-01-05 14:37:05 -0800138# golang
Yuxuan 'fishy' Wangbbc7c5f2022-01-10 11:44:23 -0800139ENV GOLANG_VERSION 1.16.13
140ENV GOLANG_DOWNLOAD_URL https://go.dev/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
141ENV GOLANG_DOWNLOAD_SHA256 275fc03c90c13b0bbff13125a43f1f7a9f9c00a0d5a9f2d5b16dbc2fa2c6e12a
John Boiles57852792018-01-05 14:37:05 -0800142RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \
143 echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \
144 tar -C /usr/local -xzf golang.tar.gz && \
145 ln -s /usr/local/go/bin/go /usr/local/bin && \
146 rm golang.tar.gz
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700147
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700148RUN apt-get install -y --no-install-recommends \
149`# Haxe dependencies` \
150 haxe \
151 neko \
152 neko-dev \
James E. King IIIad238522018-01-13 19:52:31 -0500153 libneko0 && \
154 haxelib setup --always /usr/share/haxe/lib && \
James E. King IIIf64a3fc2018-01-14 08:54:25 -0500155 haxelib install --always hxcpp 3.4.64 2>&1 > /dev/null
James E. King, III81cdcd32017-09-09 17:54:10 +0000156# 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 -0700157
158RUN apt-get install -y --no-install-recommends \
159`# Java dependencies` \
160 ant \
161 ant-optional \
162 openjdk-8-jdk \
163 maven
164
James E. King III93ff9b02019-06-21 17:50:34 -0400165# disabled: same as ubuntu-bionic jobs
166# RUN apt-get install -y --no-install-recommends \
167# `# Lua dependencies` \
168# lua5.2 \
169# lua5.2-dev
James E. King, IIId7142b72017-09-01 13:00:36 -0700170# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
171# lua5.3 does not install alternatives so stick with 5.2 here
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700172
173RUN apt-get install -y --no-install-recommends \
174`# Node.js dependencies` \
James E. King IIIa37feaf2018-03-06 15:11:01 -0500175 nodejs
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700176
Brian Forbisb5d6ea32018-08-25 23:39:29 -0400177# Test dependencies for running puppeteer
178RUN apt-get install -y --no-install-recommends \
179`# JS dependencies` \
180 libxss1 \
Yuxuan 'fishy' Wang0f735582021-04-28 08:33:36 -0700181 libxtst6 \
Brian Forbisb5d6ea32018-08-25 23:39:29 -0400182 libatk-bridge2.0-0 \
183 libgtk-3-0
184
James E. King IIIa02ae562018-03-12 15:27:23 -0400185# THRIFT-4517: causes stack overflows; version too old; skip ocaml in xenial
186# RUN apt-get install -y --no-install-recommends \
187# `# OCaml dependencies` \
188# ocaml \
189# opam && \
190# opam init --yes && \
191# opam install --yes oasis
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700192
193RUN apt-get install -y --no-install-recommends \
194`# Perl dependencies` \
195 libbit-vector-perl \
196 libclass-accessor-class-perl \
197 libcrypt-ssleay-perl \
198 libio-socket-ssl-perl \
Kengo Sekicb4c31a2019-12-26 14:34:57 +0900199 libnet-ssleay-perl \
200 libtest-exception-perl
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700201
202RUN apt-get install -y --no-install-recommends \
203`# Php dependencies` \
204 php7.0 \
205 php7.0-cli \
206 php7.0-dev \
James E. King IIIe53d23c2019-02-10 11:13:23 -0500207 php-json \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700208 php-pear \
209 re2c \
Robert Lua15060a2017-12-28 15:29:39 +0800210 composer
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700211
212RUN apt-get install -y --no-install-recommends \
213`# Python dependencies` \
214 python-all \
215 python-all-dbg \
216 python-all-dev \
217 python-backports.ssl-match-hostname \
218 python-ipaddress \
219 python-pip \
220 python-setuptools \
James E. King, IIId7142b72017-09-01 13:00:36 -0700221 python-six \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700222 python-tornado \
223 python-twisted \
James E. King, IIId7142b72017-09-01 13:00:36 -0700224 python-wheel \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700225 python-zope.interface \
226 python3-all \
227 python3-all-dbg \
228 python3-all-dev \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700229 python3-setuptools \
James E. King, IIId7142b72017-09-01 13:00:36 -0700230 python3-six \
231 python3-tornado \
232 python3-twisted \
233 python3-wheel \
234 python3-zope.interface && \
235 pip install --upgrade backports.ssl_match_hostname
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700236
237RUN apt-get install -y --no-install-recommends \
238`# Ruby dependencies` \
Jano Svitok299b68e2020-03-09 23:07:30 +0100239 ruby2.4 \
240 ruby2.4-dev \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700241 ruby-bundler
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700242
Danny Browning181d9002019-04-15 09:50:24 -0600243# Rust dependencies
Allen Georgeb0d14132020-03-29 11:48:55 -0400244RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.40.0 -y
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700245
ubuntu323f0322021-05-31 19:08:05 +0530246# Locale(s) for cpp unit tests
247RUN apt-get install -y --no-install-recommends \
248`# Locale dependencies` \
249 locales && \
250 locale-gen en_US.UTF-8 && \
ubuntuad76a182021-06-07 08:21:05 +0530251 locale-gen de_DE.UTF-8 && \
ubuntu323f0322021-05-31 19:08:05 +0530252 update-locale
253
Aki Sukegawa7594da82022-03-07 00:28:26 -0500254# NOTE: this does not reduce the image size but adds an additional layer.
255# # Clean up
256# RUN rm -rf /var/cache/apt/* && \
257# rm -rf /var/lib/apt/lists/* && \
258# rm -rf /tmp/* && \
259# rm -rf /var/tmp/*
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700260
James E. King, IIIb6287362017-09-28 11:57:42 +0000261ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700262ENV THRIFT_ROOT /thrift
263RUN mkdir -p $THRIFT_ROOT/src
264COPY Dockerfile $THRIFT_ROOT/
265WORKDIR $THRIFT_ROOT/src