blob: 0e11d2ac68af0496e67c19812073c37f8a5ace7c [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
19MAINTAINER Apache Thrift <dev@thrift.apache.org>
20ENV DEBIAN_FRONTEND noninteractive
21
22### Add apt repos
23
24RUN apt-get update && \
25 apt-get dist-upgrade -y && \
Allen Georgeb0d14132020-03-29 11:48:55 -040026 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 - && \
37 curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > \
38 /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 && \
42 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
45
46# node.js
47RUN curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
James E. King III93ff9b02019-06-21 17:50:34 -040048 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 \
52`# General dependencies` \
53 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 && \
74 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
77ENV 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 \
82`# C++ dependencies` \
83 libboost-all-dev \
84 libevent-dev \
85 libssl-dev \
86 qt5-default \
87 qtbase5-dev \
88 qtbase5-dev-tools
89
James E. King III93ff9b02019-06-21 17:50:34 -040090ENV D_VERSION 2.087.0
91ENV DMD_DEB dmd_2.087.0-0_amd64.deb
James E. King IIIf5f430d2018-06-08 03:37:55 +000092RUN \
93`# D dependencies` \
94 wget -q http://downloads.dlang.org/releases/2.x/${D_VERSION}/${DMD_DEB} && \
95 dpkg --install ${DMD_DEB} && \
96 rm -f ${DMD_DEB} && \
97 mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
James E. King IIIabf3aa52019-01-04 17:21:02 -050098 git clone -b 'v2.0.2+2.0.16' https://github.com/D-Programming-Deimos/libevent.git deimos-libevent-2.0 && \
99 mv deimos-libevent-2.0/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
100 mv deimos-libevent-2.0/C/* /usr/include/dmd/druntime/import/C/ && \
101 rm -rf deimos-libevent-2.0 && \
James E. King III75bac102018-12-30 16:20:12 -0500102 git clone -b 'v2.0.0+1.1.0h' https://github.com/D-Programming-Deimos/openssl.git deimos-openssl-1.1.0h && \
103 mv deimos-openssl-1.1.0h/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
104 mv deimos-openssl-1.1.0h/C/* /usr/include/dmd/druntime/import/C/ && \
105 rm -rf deimos-openssl-1.1.0h
James E. King IIIf5f430d2018-06-08 03:37:55 +0000106
aaronstgeorge-wf1ab156a2020-10-01 17:28:28 +0200107ENV DART_VERSION 2.7.2-1
James E. King IIIf5f430d2018-06-08 03:37:55 +0000108RUN apt-get install -y --no-install-recommends \
Mario Emmenlauer96ed7272021-08-30 10:54:39 +0200109`# Dart dependencies` \
Brian Forbisc64389a2018-09-22 07:36:24 -0400110 dart=$DART_VERSION
James E. King IIIf5f430d2018-06-08 03:37:55 +0000111ENV PATH /usr/lib/dart/bin:$PATH
112
113RUN apt-get install -y --no-install-recommends \
114`# dotnet core dependencies` \
Jens Geyer4c7b9fd2021-12-04 22:48:37 +0100115 dotnet-sdk-6.0 \
116 dotnet-runtime-6.0 \
117 aspnetcore-runtime-6.0 \
118 dotnet-apphost-pack-6.0
James E. King IIIf5f430d2018-06-08 03:37:55 +0000119
Aki Sukegawa7594da82022-03-07 00:28:26 -0500120# Erlang dependencies
121ARG ERLANG_OTP_VERSION=23.3.4.11
122ARG ERLANG_REBAR_VERSION=3.18.0
123RUN apt-get update && apt-get install -y --no-install-recommends libncurses5-dev && \
124 curl -ssLo /usr/local/bin/kerl https://raw.githubusercontent.com/kerl/kerl/master/kerl && chmod +x /usr/local/bin/kerl && \
125 kerl build $ERLANG_OTP_VERSION && kerl install $ERLANG_OTP_VERSION /usr/local/lib/otp/ && . /usr/local/lib/otp/activate && \
126 curl -ssLo /usr/local/bin/rebar3 https://github.com/erlang/rebar3/releases/download/${ERLANG_REBAR_VERSION}/rebar3 && chmod +x /usr/local/bin/rebar3 && \
James E. King III93ff9b02019-06-21 17:50:34 -0400127 rebar3 --version
Aki Sukegawa7594da82022-03-07 00:28:26 -0500128ENV PATH /usr/local/lib/otp/bin:$PATH
James E. King IIIf5f430d2018-06-08 03:37:55 +0000129
130RUN apt-get install -y --no-install-recommends \
131`# GlibC dependencies` \
132 libglib2.0-dev
133
134# golang
Yuxuan 'fishy' Wangbbc7c5f2022-01-10 11:44:23 -0800135ENV GOLANG_VERSION 1.17.6
136ENV GOLANG_DOWNLOAD_URL https://go.dev/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
137ENV GOLANG_DOWNLOAD_SHA256 231654bbf2dab3d86c1619ce799e77b03d96f9b50770297c8f4dff8836fc8ca2
James E. King IIIf5f430d2018-06-08 03:37:55 +0000138RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \
139 echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \
140 tar -C /usr/local -xzf golang.tar.gz && \
141 ln -s /usr/local/go/bin/go /usr/local/bin && \
142 rm golang.tar.gz
143
144RUN apt-get install -y --no-install-recommends \
James E. King IIIf5f430d2018-06-08 03:37:55 +0000145`# Haxe dependencies` \
146 haxe \
147 neko \
148 neko-dev && \
149 haxelib setup --always /usr/share/haxe/lib && \
150 haxelib install --always hxcpp 2>&1 > /dev/null
151
152RUN apt-get install -y --no-install-recommends \
153`# Java dependencies` \
154 ant \
155 ant-optional \
Fokko Driesprong1686c872019-02-01 20:31:58 +0100156 maven \
157 openjdk-11-jdk-headless
James E. King IIIf5f430d2018-06-08 03:37:55 +0000158
159RUN apt-get install -y --no-install-recommends \
160`# Lua dependencies` \
161 lua5.2 \
162 lua5.2-dev
163# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
164# lua5.3 does not install alternatives!
165# need to update our luasocket code, lua doesn't have luaL_openlib any more
166
167RUN apt-get install -y --no-install-recommends \
168`# Node.js dependencies` \
169 nodejs
170
Brian Forbisb5d6ea32018-08-25 23:39:29 -0400171# Test dependencies for running puppeteer
172RUN apt-get install -y --no-install-recommends \
173`# JS dependencies` \
Yuxuan 'fishy' Wang0f735582021-04-28 08:33:36 -0700174 libxss1 \
175 libxtst6
Brian Forbisb5d6ea32018-08-25 23:39:29 -0400176
James E. King IIIf5f430d2018-06-08 03:37:55 +0000177RUN apt-get install -y --no-install-recommends \
178`# OCaml dependencies` \
179 ocaml \
180 opam && \
181 opam init --yes && \
182 opam install --yes oasis
183
184RUN apt-get install -y --no-install-recommends \
185`# Perl dependencies` \
186 libbit-vector-perl \
187 libclass-accessor-class-perl \
188 libcrypt-ssleay-perl \
189 libio-socket-ssl-perl \
Kengo Sekicb4c31a2019-12-26 14:34:57 +0900190 libnet-ssleay-perl \
191 libtest-exception-perl
James E. King IIIf5f430d2018-06-08 03:37:55 +0000192
193RUN apt-get install -y --no-install-recommends \
194`# Php dependencies` \
195 php \
196 php-cli \
197 php-dev \
James E. King IIIe53d23c2019-02-10 11:13:23 -0500198 php-json \
James E. King IIIf5f430d2018-06-08 03:37:55 +0000199 php-pear \
200 re2c \
201 composer
202
203RUN apt-get install -y --no-install-recommends \
204`# Python dependencies` \
205 python-all \
206 python-all-dbg \
207 python-all-dev \
208 python-ipaddress \
209 python-pip \
210 python-setuptools \
211 python-six \
212 python-tornado \
213 python-twisted \
214 python-wheel \
215 python-zope.interface && \
216 pip install --upgrade backports.ssl_match_hostname
217
218RUN apt-get install -y --no-install-recommends \
219`# Python3 dependencies` \
220 python3-all \
221 python3-all-dbg \
222 python3-all-dev \
223 python3-pip \
224 python3-setuptools \
225 python3-six \
226 python3-tornado \
227 python3-twisted \
228 python3-wheel \
229 python3-zope.interface
230
231RUN apt-get install -y --no-install-recommends \
232`# Ruby dependencies` \
233 ruby \
234 ruby-dev \
235 ruby-bundler
236
Danny Browning181d9002019-04-15 09:50:24 -0600237# Rust dependencies
Allen Georgeb0d14132020-03-29 11:48:55 -0400238RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.40.0 -y
James E. King III93ff9b02019-06-21 17:50:34 -0400239ENV PATH /root/.cargo/bin:$PATH
James E. King IIIf5f430d2018-06-08 03:37:55 +0000240
James E. King IIIa3a7c6c2018-12-31 17:17:34 -0500241# Swift on Linux for cross tests
242RUN cd / && \
Jano Svitok2e115772020-03-06 09:01:43 +0100243 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 && \
244 tar xf swift-5.1.4-RELEASE-ubuntu18.04.tar.gz --strip-components=1 && \
245 rm swift-5.1.4-RELEASE-ubuntu18.04.tar.gz && \
James E. King IIIa3a7c6c2018-12-31 17:17:34 -0500246 swift --version
247
ubuntu323f0322021-05-31 19:08:05 +0530248# Locale(s) for cpp unit tests
249RUN apt-get install -y --no-install-recommends \
250`# Locale dependencies` \
251 locales && \
252 locale-gen en_US.UTF-8 && \
ubuntuad76a182021-06-07 08:21:05 +0530253 locale-gen de_DE.UTF-8 && \
ubuntu323f0322021-05-31 19:08:05 +0530254 update-locale
255
James E. King IIIf5f430d2018-06-08 03:37:55 +0000256# cppcheck-1.82 has a nasty cpp parser bug, so we're using something newer
257RUN apt-get install -y --no-install-recommends \
258`# Static Code Analysis dependencies` \
259 cppcheck \
260 sloccount && \
261 pip install flake8 && \
262 wget -q "https://launchpad.net/ubuntu/+source/cppcheck/1.83-2/+build/14874703/+files/cppcheck_1.83-2_amd64.deb" && \
263 dpkg -i cppcheck_1.83-2_amd64.deb && \
264 rm cppcheck_1.83-2_amd64.deb
265
Aki Sukegawa7594da82022-03-07 00:28:26 -0500266# NOTE: this does not reduce the image size but adds an additional layer.
267# # Clean up
268# RUN rm -rf /var/cache/apt/* && \
269# rm -rf /var/lib/apt/lists/* && \
270# rm -rf /tmp/* && \
271# rm -rf /var/tmp/*
James E. King IIIf5f430d2018-06-08 03:37:55 +0000272
273ENV THRIFT_ROOT /thrift
274RUN mkdir -p $THRIFT_ROOT/src
275COPY Dockerfile $THRIFT_ROOT/
276WORKDIR $THRIFT_ROOT/src