blob: b786ab5056ca97975fa1059e1eda2471d543651b [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
James E. King III93ff9b02019-06-21 17:50:34 -040015# with some updated packages.
James E. King IIIf5f430d2018-06-08 03:37:55 +000016#
17
18FROM buildpack-deps:bionic-scm
Jiayu Liuc5d03242022-09-26 23:04:26 +080019LABEL MAINTAINER='Apache Thrift <dev@thrift.apache.org>'
James E. King IIIf5f430d2018-06-08 03:37:55 +000020ENV DEBIAN_FRONTEND noninteractive
21
22### Add apt repos
23
Jiayu Liuc5d03242022-09-26 23:04:26 +080024RUN apt-get update -yq && \
Jiayu Liu8a321562022-09-06 08:57:19 +080025 apt-get dist-upgrade -y && \
26 apt-get install -y --no-install-recommends --fix-missing \
James E. King IIIf5f430d2018-06-08 03:37:55 +000027 apt \
28 apt-transport-https \
29 apt-utils \
30 curl \
31 dirmngr \
32 software-properties-common \
33 wget
34
James E. King IIIf5f430d2018-06-08 03:37:55 +000035# Dart
36RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
Jiayu Liu8a321562022-09-06 08:57:19 +080037 curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > \
James E. King IIIf5f430d2018-06-08 03:37:55 +000038 /etc/apt/sources.list.d/dart_stable.list
39
40# dotnet (netcore)
41RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \
Jiayu Liu8a321562022-09-06 08:57:19 +080042 wget -q -O /etc/apt/sources.list.d/microsoft-prod.list https://packages.microsoft.com/config/ubuntu/18.04/prod.list && \
43 chown root:root /etc/apt/trusted.gpg.d/microsoft.gpg && \
44 chown root:root /etc/apt/sources.list.d/microsoft-prod.list
James E. King IIIf5f430d2018-06-08 03:37:55 +000045
46# node.js
47RUN curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
Jiayu Liu8a321562022-09-06 08:57:19 +080048 echo "deb https://deb.nodesource.com/node_10.x bionic main" | tee /etc/apt/sources.list.d/nodesource.list
James E. King IIIf5f430d2018-06-08 03:37:55 +000049
50### install general dependencies
51RUN apt-get update && apt-get install -y --no-install-recommends \
Jiayu Liu8a321562022-09-06 08:57:19 +080052 `# General dependencies` \
James E. King IIIf5f430d2018-06-08 03:37:55 +000053 bash-completion \
54 bison \
55 build-essential \
56 clang \
57 cmake \
58 debhelper \
59 flex \
60 gdb \
Fokko Driesprong1686c872019-02-01 20:31:58 +010061 libasound2 \
62 libatk-bridge2.0-0 \
63 libgtk-3-0 \
James E. King IIIf5f430d2018-06-08 03:37:55 +000064 llvm \
65 ninja-build \
66 pkg-config \
James E. King IIIb1d63e72019-01-22 14:16:39 -050067 unzip \
James E. King IIIf5f430d2018-06-08 03:37:55 +000068 valgrind \
69 vim
70ENV PATH /usr/lib/llvm-6.0/bin:$PATH
71
James E. King IIIb1d63e72019-01-22 14:16:39 -050072# lib/as3 (ActionScript)
73RUN mkdir -p /usr/local/adobe/flex/4.6 && \
Jiayu Liu8a321562022-09-06 08:57:19 +080074 cd /usr/local/adobe/flex/4.6 && \
75 wget -q "http://download.macromedia.com/pub/flex/sdk/flex_sdk_4.6.zip" && \
76 unzip flex_sdk_4.6.zip
James E. King IIIb1d63e72019-01-22 14:16:39 -050077ENV FLEX_HOME /usr/local/adobe/flex/4.6
78
Aki Sukegawa7594da82022-03-07 00:28:26 -050079# TODO: "apt-get install" without "apt-get update" in the same "RUN" step can cause cache issues if modified later.
80# See https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#run
James E. King IIIf5f430d2018-06-08 03:37:55 +000081RUN apt-get install -y --no-install-recommends \
Jiayu Liu8a321562022-09-06 08:57:19 +080082 `# C++ dependencies` \
James E. King IIIf5f430d2018-06-08 03:37:55 +000083 libboost-all-dev \
84 libevent-dev \
85 libssl-dev \
86 qt5-default \
87 qtbase5-dev \
88 qtbase5-dev-tools
89
Max-Gerd Retzlaff04057ac2022-08-23 17:38:34 +020090ENV SBCL_VERSION 1.5.3
91RUN \
Jiayu Liu8a321562022-09-06 08:57:19 +080092 `# Common Lisp (sbcl) dependencies` \
93 curl --version && \
94 curl -o sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2 -J -L https://sourceforge.net/projects/sbcl/files/sbcl/${SBCL_VERSION}/sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2/download?use_mirror=managedway# && \
95 tar xjf sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2 && \
96 cd sbcl-${SBCL_VERSION}-x86-64-linux && \
97 ./install.sh && \
98 sbcl --version && \
99 cd .. && \
100 rm -rf sbcl*
Max-Gerd Retzlaff04057ac2022-08-23 17:38:34 +0200101
James E. King III93ff9b02019-06-21 17:50:34 -0400102ENV D_VERSION 2.087.0
103ENV DMD_DEB dmd_2.087.0-0_amd64.deb
James E. King IIIf5f430d2018-06-08 03:37:55 +0000104RUN \
Jiayu Liu8a321562022-09-06 08:57:19 +0800105 `# D dependencies` \
106 wget -q http://downloads.dlang.org/releases/2.x/${D_VERSION}/${DMD_DEB} && \
107 dpkg --install ${DMD_DEB} && \
108 rm -f ${DMD_DEB} && \
109 mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
110 git clone -b 'v2.0.2+2.0.16' https://github.com/D-Programming-Deimos/libevent.git deimos-libevent-2.0 && \
111 mv deimos-libevent-2.0/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
112 mv deimos-libevent-2.0/C/* /usr/include/dmd/druntime/import/C/ && \
113 rm -rf deimos-libevent-2.0 && \
114 git clone -b 'v2.0.0+1.1.0h' https://github.com/D-Programming-Deimos/openssl.git deimos-openssl-1.1.0h && \
115 mv deimos-openssl-1.1.0h/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
116 mv deimos-openssl-1.1.0h/C/* /usr/include/dmd/druntime/import/C/ && \
117 rm -rf deimos-openssl-1.1.0h
James E. King IIIf5f430d2018-06-08 03:37:55 +0000118
aaronstgeorge-wf1ab156a2020-10-01 17:28:28 +0200119ENV DART_VERSION 2.7.2-1
James E. King IIIf5f430d2018-06-08 03:37:55 +0000120RUN apt-get install -y --no-install-recommends \
Jiayu Liu8a321562022-09-06 08:57:19 +0800121 `# Dart dependencies` \
Brian Forbisc64389a2018-09-22 07:36:24 -0400122 dart=$DART_VERSION
James E. King IIIf5f430d2018-06-08 03:37:55 +0000123ENV PATH /usr/lib/dart/bin:$PATH
124
125RUN apt-get install -y --no-install-recommends \
Jiayu Liu8a321562022-09-06 08:57:19 +0800126 `# dotnet core dependencies` \
Jens Geyer4c7b9fd2021-12-04 22:48:37 +0100127 dotnet-sdk-6.0 \
128 dotnet-runtime-6.0 \
129 aspnetcore-runtime-6.0 \
130 dotnet-apphost-pack-6.0
James E. King IIIf5f430d2018-06-08 03:37:55 +0000131
Aki Sukegawa7594da82022-03-07 00:28:26 -0500132# Erlang dependencies
133ARG ERLANG_OTP_VERSION=23.3.4.11
134ARG ERLANG_REBAR_VERSION=3.18.0
135RUN apt-get update && apt-get install -y --no-install-recommends libncurses5-dev && \
Jiayu Liu8a321562022-09-06 08:57:19 +0800136 curl -ssLo /usr/local/bin/kerl https://raw.githubusercontent.com/kerl/kerl/master/kerl && chmod +x /usr/local/bin/kerl && \
137 kerl build $ERLANG_OTP_VERSION && kerl install $ERLANG_OTP_VERSION /usr/local/lib/otp/ && . /usr/local/lib/otp/activate && \
138 curl -ssLo /usr/local/bin/rebar3 https://github.com/erlang/rebar3/releases/download/${ERLANG_REBAR_VERSION}/rebar3 && chmod +x /usr/local/bin/rebar3 && \
139 rebar3 --version
Aki Sukegawa7594da82022-03-07 00:28:26 -0500140ENV PATH /usr/local/lib/otp/bin:$PATH
James E. King IIIf5f430d2018-06-08 03:37:55 +0000141
142RUN apt-get install -y --no-install-recommends \
Jiayu Liu8a321562022-09-06 08:57:19 +0800143 `# GlibC dependencies` \
James E. King IIIf5f430d2018-06-08 03:37:55 +0000144 libglib2.0-dev
145
146# golang
Yuxuan 'fishy' Wang3f9b7d02022-08-02 11:31:14 -0700147ENV GOLANG_VERSION 1.19
Yuxuan 'fishy' Wangbbc7c5f2022-01-10 11:44:23 -0800148ENV GOLANG_DOWNLOAD_URL https://go.dev/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
Yuxuan 'fishy' Wang3f9b7d02022-08-02 11:31:14 -0700149ENV GOLANG_DOWNLOAD_SHA256 464b6b66591f6cf055bc5df90a9750bf5fbc9d038722bb84a9d56a2bea974be6
James E. King IIIf5f430d2018-06-08 03:37:55 +0000150RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \
151 echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \
Jiayu Liu8a321562022-09-06 08:57:19 +0800152 tar -C /usr/local -xzf golang.tar.gz && \
153 ln -s /usr/local/go/bin/go /usr/local/bin && \
154 rm golang.tar.gz
James E. King IIIf5f430d2018-06-08 03:37:55 +0000155
156RUN apt-get install -y --no-install-recommends \
Jiayu Liu8a321562022-09-06 08:57:19 +0800157 `# Haxe dependencies` \
James E. King IIIf5f430d2018-06-08 03:37:55 +0000158 haxe \
159 neko \
160 neko-dev && \
Jiayu Liu8a321562022-09-06 08:57:19 +0800161 haxelib setup --always /usr/share/haxe/lib && \
162 haxelib install --always hxcpp 2>&1 > /dev/null
James E. King IIIf5f430d2018-06-08 03:37:55 +0000163
Jiayu Liu8a321562022-09-06 08:57:19 +0800164ENV GRADLE_VERSION="7.5.1"
James E. King IIIf5f430d2018-06-08 03:37:55 +0000165RUN apt-get install -y --no-install-recommends \
Jiayu Liu8a321562022-09-06 08:57:19 +0800166 `# Java dependencies` \
James E. King IIIf5f430d2018-06-08 03:37:55 +0000167 ant \
168 ant-optional \
Fokko Driesprong1686c872019-02-01 20:31:58 +0100169 maven \
Jiayu Liu5d220eb2022-04-19 04:18:58 +0200170 openjdk-11-jdk-headless && \
Jiayu Liu8a321562022-09-06 08:57:19 +0800171 `# Gradle` \
Jiayu Liu5d220eb2022-04-19 04:18:58 +0200172 wget https://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip -q -O /tmp/gradle-$GRADLE_VERSION-bin.zip && \
Jiayu Liu8a321562022-09-06 08:57:19 +0800173 (echo "f6b8596b10cce501591e92f229816aa4046424f3b24d771751b06779d58c8ec4 /tmp/gradle-$GRADLE_VERSION-bin.zip" | sha256sum -c -) && \
Jiayu Liu5d220eb2022-04-19 04:18:58 +0200174 unzip -d /tmp /tmp/gradle-$GRADLE_VERSION-bin.zip && \
175 mv /tmp/gradle-$GRADLE_VERSION /usr/local/gradle && \
176 ln -s /usr/local/gradle/bin/gradle /usr/local/bin
James E. King IIIf5f430d2018-06-08 03:37:55 +0000177
178RUN apt-get install -y --no-install-recommends \
Jiayu Liu8a321562022-09-06 08:57:19 +0800179 `# Lua dependencies` \
James E. King IIIf5f430d2018-06-08 03:37:55 +0000180 lua5.2 \
181 lua5.2-dev
182# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
183# lua5.3 does not install alternatives!
184# need to update our luasocket code, lua doesn't have luaL_openlib any more
185
186RUN apt-get install -y --no-install-recommends \
Jiayu Liu8a321562022-09-06 08:57:19 +0800187 `# Node.js dependencies` \
James E. King IIIf5f430d2018-06-08 03:37:55 +0000188 nodejs
189
Brian Forbisb5d6ea32018-08-25 23:39:29 -0400190# Test dependencies for running puppeteer
191RUN apt-get install -y --no-install-recommends \
Jiayu Liu8a321562022-09-06 08:57:19 +0800192 `# JS dependencies` \
Yuxuan 'fishy' Wang0f735582021-04-28 08:33:36 -0700193 libxss1 \
194 libxtst6
Brian Forbisb5d6ea32018-08-25 23:39:29 -0400195
James E. King IIIf5f430d2018-06-08 03:37:55 +0000196RUN apt-get install -y --no-install-recommends \
Jiayu Liu8a321562022-09-06 08:57:19 +0800197 `# OCaml dependencies` \
James E. King IIIf5f430d2018-06-08 03:37:55 +0000198 ocaml \
199 opam && \
Jiayu Liu11031cc2022-09-27 17:29:01 +0800200 opam init --yes && \
Jiayu Liu8a321562022-09-06 08:57:19 +0800201 opam install --yes oasis
James E. King IIIf5f430d2018-06-08 03:37:55 +0000202
203RUN apt-get install -y --no-install-recommends \
Jiayu Liu8a321562022-09-06 08:57:19 +0800204 `# Perl dependencies` \
James E. King IIIf5f430d2018-06-08 03:37:55 +0000205 libbit-vector-perl \
206 libclass-accessor-class-perl \
207 libcrypt-ssleay-perl \
208 libio-socket-ssl-perl \
Kengo Sekicb4c31a2019-12-26 14:34:57 +0900209 libnet-ssleay-perl \
210 libtest-exception-perl
James E. King IIIf5f430d2018-06-08 03:37:55 +0000211
212RUN apt-get install -y --no-install-recommends \
Jiayu Liu8a321562022-09-06 08:57:19 +0800213 `# Php dependencies` \
James E. King IIIf5f430d2018-06-08 03:37:55 +0000214 php \
215 php-cli \
216 php-dev \
James E. King IIIe53d23c2019-02-10 11:13:23 -0500217 php-json \
James E. King IIIf5f430d2018-06-08 03:37:55 +0000218 php-pear \
219 re2c \
220 composer
221
222RUN apt-get install -y --no-install-recommends \
Jiayu Liu8a321562022-09-06 08:57:19 +0800223 `# Python dependencies` \
James E. King IIIf5f430d2018-06-08 03:37:55 +0000224 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 && \
Jiayu Liu8a321562022-09-06 08:57:19 +0800235 pip install --upgrade backports.ssl_match_hostname
James E. King IIIf5f430d2018-06-08 03:37:55 +0000236
237RUN apt-get install -y --no-install-recommends \
Jiayu Liu8a321562022-09-06 08:57:19 +0800238 `# Python3 dependencies` \
James E. King IIIf5f430d2018-06-08 03:37:55 +0000239 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 \
Jiayu Liu8a321562022-09-06 08:57:19 +0800251 `# Ruby dependencies` \
James E. King IIIf5f430d2018-06-08 03:37:55 +0000252 ruby \
253 ruby-dev \
254 ruby-bundler
255
Danny Browning181d9002019-04-15 09:50:24 -0600256# Rust dependencies
Tdxdxoz85d82bf2022-07-17 14:14:12 +0200257RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.61.0 -y
James E. King III93ff9b02019-06-21 17:50:34 -0400258ENV PATH /root/.cargo/bin:$PATH
James E. King IIIf5f430d2018-06-08 03:37:55 +0000259
James E. King IIIa3a7c6c2018-12-31 17:17:34 -0500260# Swift on Linux for cross tests
Jiayu Liuc5d03242022-09-26 23:04:26 +0800261RUN apt-get install -yq \
262 libedit-dev \
263 libz3-dev \
264 libpython-dev \
265 libxml2-dev && \
266 cd / && \
Jiayu Liu8a321562022-09-06 08:57:19 +0800267 wget --quiet https://swift.org/builds/swift-5.1.4-release/ubuntu1804/swift-5.1.4-RELEASE/swift-5.1.4-RELEASE-ubuntu18.04.tar.gz && \
268 tar xf swift-5.1.4-RELEASE-ubuntu18.04.tar.gz --strip-components=1 && \
269 rm swift-5.1.4-RELEASE-ubuntu18.04.tar.gz && \
270 swift --version
James E. King IIIa3a7c6c2018-12-31 17:17:34 -0500271
ubuntu323f0322021-05-31 19:08:05 +0530272# Locale(s) for cpp unit tests
273RUN apt-get install -y --no-install-recommends \
Jiayu Liu8a321562022-09-06 08:57:19 +0800274 `# Locale dependencies` \
ubuntu323f0322021-05-31 19:08:05 +0530275 locales && \
Jiayu Liu8a321562022-09-06 08:57:19 +0800276 locale-gen en_US.UTF-8 && \
277 locale-gen de_DE.UTF-8 && \
278 update-locale
ubuntu323f0322021-05-31 19:08:05 +0530279
James E. King IIIf5f430d2018-06-08 03:37:55 +0000280RUN apt-get install -y --no-install-recommends \
Jiayu Liu8a321562022-09-06 08:57:19 +0800281 `# Static Code Analysis dependencies` \
James E. King IIIf5f430d2018-06-08 03:37:55 +0000282 cppcheck \
283 sloccount && \
Jiayu Liuc5d03242022-09-26 23:04:26 +0800284 pip install flake8
James E. King IIIf5f430d2018-06-08 03:37:55 +0000285
Aki Sukegawa7594da82022-03-07 00:28:26 -0500286# NOTE: this does not reduce the image size but adds an additional layer.
287# # Clean up
288# RUN rm -rf /var/cache/apt/* && \
289# rm -rf /var/lib/apt/lists/* && \
290# rm -rf /tmp/* && \
291# rm -rf /var/tmp/*
James E. King IIIf5f430d2018-06-08 03:37:55 +0000292
293ENV THRIFT_ROOT /thrift
294RUN mkdir -p $THRIFT_ROOT/src
295COPY Dockerfile $THRIFT_ROOT/
296WORKDIR $THRIFT_ROOT/src