blob: 9b235f6f1cf4108cba88390afec8f8a2314dfcf8 [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
James E. King III93ff9b02019-06-21 17:50:34 -040046# erlang
47RUN wget -O- https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc | apt-key add - && \
48 echo "deb https://packages.erlang-solutions.com/ubuntu bionic contrib" | tee /etc/apt/sources.list.d/erlang.list
49
James E. King IIIf5f430d2018-06-08 03:37:55 +000050# node.js
51RUN curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
James E. King III93ff9b02019-06-21 17:50:34 -040052 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 +000053
54### install general dependencies
55RUN apt-get update && apt-get install -y --no-install-recommends \
56`# General dependencies` \
57 bash-completion \
58 bison \
59 build-essential \
60 clang \
61 cmake \
62 debhelper \
63 flex \
64 gdb \
Fokko Driesprong1686c872019-02-01 20:31:58 +010065 libasound2 \
66 libatk-bridge2.0-0 \
67 libgtk-3-0 \
James E. King IIIf5f430d2018-06-08 03:37:55 +000068 llvm \
69 ninja-build \
70 pkg-config \
James E. King IIIb1d63e72019-01-22 14:16:39 -050071 unzip \
James E. King IIIf5f430d2018-06-08 03:37:55 +000072 valgrind \
73 vim
74ENV PATH /usr/lib/llvm-6.0/bin:$PATH
75
James E. King IIIb1d63e72019-01-22 14:16:39 -050076# lib/as3 (ActionScript)
77RUN mkdir -p /usr/local/adobe/flex/4.6 && \
78 cd /usr/local/adobe/flex/4.6 && \
79 wget -q "http://download.macromedia.com/pub/flex/sdk/flex_sdk_4.6.zip" && \
80 unzip flex_sdk_4.6.zip
81ENV FLEX_HOME /usr/local/adobe/flex/4.6
82
James E. King IIIf5f430d2018-06-08 03:37:55 +000083RUN apt-get install -y --no-install-recommends \
84`# C++ dependencies` \
85 libboost-all-dev \
86 libevent-dev \
87 libssl-dev \
88 qt5-default \
89 qtbase5-dev \
90 qtbase5-dev-tools
91
James E. King III93ff9b02019-06-21 17:50:34 -040092ENV SBCL_VERSION 1.5.3
James E. King IIIf5f430d2018-06-08 03:37:55 +000093RUN \
94`# Common Lisp (sbcl) dependencies` \
95 curl --version && \
James E. King IIIabf3aa52019-01-04 17:21:02 -050096 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# && \
James E. King IIIf5f430d2018-06-08 03:37:55 +000097 tar xjf sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2 && \
98 cd sbcl-${SBCL_VERSION}-x86-64-linux && \
99 ./install.sh && \
100 sbcl --version && \
101 cd .. && \
102 rm -rf sbcl*
103
James E. King III93ff9b02019-06-21 17:50:34 -0400104ENV D_VERSION 2.087.0
105ENV DMD_DEB dmd_2.087.0-0_amd64.deb
James E. King IIIf5f430d2018-06-08 03:37:55 +0000106RUN \
107`# D dependencies` \
108 wget -q http://downloads.dlang.org/releases/2.x/${D_VERSION}/${DMD_DEB} && \
109 dpkg --install ${DMD_DEB} && \
110 rm -f ${DMD_DEB} && \
111 mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
James E. King IIIabf3aa52019-01-04 17:21:02 -0500112 git clone -b 'v2.0.2+2.0.16' https://github.com/D-Programming-Deimos/libevent.git deimos-libevent-2.0 && \
113 mv deimos-libevent-2.0/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
114 mv deimos-libevent-2.0/C/* /usr/include/dmd/druntime/import/C/ && \
115 rm -rf deimos-libevent-2.0 && \
James E. King III75bac102018-12-30 16:20:12 -0500116 git clone -b 'v2.0.0+1.1.0h' https://github.com/D-Programming-Deimos/openssl.git deimos-openssl-1.1.0h && \
117 mv deimos-openssl-1.1.0h/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
118 mv deimos-openssl-1.1.0h/C/* /usr/include/dmd/druntime/import/C/ && \
119 rm -rf deimos-openssl-1.1.0h
James E. King IIIf5f430d2018-06-08 03:37:55 +0000120
aaronstgeorge-wf1ab156a2020-10-01 17:28:28 +0200121ENV DART_VERSION 2.7.2-1
James E. King IIIf5f430d2018-06-08 03:37:55 +0000122RUN apt-get install -y --no-install-recommends \
Mario Emmenlauer96ed7272021-08-30 10:54:39 +0200123`# Dart dependencies` \
Brian Forbisc64389a2018-09-22 07:36:24 -0400124 dart=$DART_VERSION
James E. King IIIf5f430d2018-06-08 03:37:55 +0000125ENV PATH /usr/lib/dart/bin:$PATH
126
127RUN apt-get install -y --no-install-recommends \
128`# dotnet core dependencies` \
Jens Geyer4c7b9fd2021-12-04 22:48:37 +0100129 dotnet-sdk-6.0 \
130 dotnet-runtime-6.0 \
131 aspnetcore-runtime-6.0 \
132 dotnet-apphost-pack-6.0
James E. King IIIf5f430d2018-06-08 03:37:55 +0000133
134RUN apt-get install -y --no-install-recommends \
135`# Erlang dependencies` \
James E. King III93ff9b02019-06-21 17:50:34 -0400136 erlang && \
137 wget https://s3.amazonaws.com/rebar3/rebar3 -O /usr/bin/rebar3 && \
138 chmod 755 /usr/bin/rebar3 && \
139 rebar3 --version
James E. King IIIf5f430d2018-06-08 03:37:55 +0000140
141RUN apt-get install -y --no-install-recommends \
142`# GlibC dependencies` \
143 libglib2.0-dev
144
145# golang
Yuxuan 'fishy' Wangbbc7c5f2022-01-10 11:44:23 -0800146ENV GOLANG_VERSION 1.17.6
147ENV GOLANG_DOWNLOAD_URL https://go.dev/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
148ENV GOLANG_DOWNLOAD_SHA256 231654bbf2dab3d86c1619ce799e77b03d96f9b50770297c8f4dff8836fc8ca2
James E. King IIIf5f430d2018-06-08 03:37:55 +0000149RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \
150 echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \
151 tar -C /usr/local -xzf golang.tar.gz && \
152 ln -s /usr/local/go/bin/go /usr/local/bin && \
153 rm golang.tar.gz
154
155RUN apt-get install -y --no-install-recommends \
James E. King IIIf5f430d2018-06-08 03:37:55 +0000156`# Haxe dependencies` \
157 haxe \
158 neko \
159 neko-dev && \
160 haxelib setup --always /usr/share/haxe/lib && \
161 haxelib install --always hxcpp 2>&1 > /dev/null
162
163RUN apt-get install -y --no-install-recommends \
164`# Java dependencies` \
165 ant \
166 ant-optional \
Fokko Driesprong1686c872019-02-01 20:31:58 +0100167 maven \
168 openjdk-11-jdk-headless
James E. King IIIf5f430d2018-06-08 03:37:55 +0000169
170RUN apt-get install -y --no-install-recommends \
171`# Lua dependencies` \
172 lua5.2 \
173 lua5.2-dev
174# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
175# lua5.3 does not install alternatives!
176# need to update our luasocket code, lua doesn't have luaL_openlib any more
177
178RUN apt-get install -y --no-install-recommends \
179`# Node.js dependencies` \
180 nodejs
181
Brian Forbisb5d6ea32018-08-25 23:39:29 -0400182# Test dependencies for running puppeteer
183RUN apt-get install -y --no-install-recommends \
184`# JS dependencies` \
Yuxuan 'fishy' Wang0f735582021-04-28 08:33:36 -0700185 libxss1 \
186 libxtst6
Brian Forbisb5d6ea32018-08-25 23:39:29 -0400187
James E. King IIIf5f430d2018-06-08 03:37:55 +0000188RUN apt-get install -y --no-install-recommends \
189`# OCaml dependencies` \
190 ocaml \
191 opam && \
192 opam init --yes && \
193 opam install --yes oasis
194
195RUN apt-get install -y --no-install-recommends \
196`# Perl dependencies` \
197 libbit-vector-perl \
198 libclass-accessor-class-perl \
199 libcrypt-ssleay-perl \
200 libio-socket-ssl-perl \
Kengo Sekicb4c31a2019-12-26 14:34:57 +0900201 libnet-ssleay-perl \
202 libtest-exception-perl
James E. King IIIf5f430d2018-06-08 03:37:55 +0000203
204RUN apt-get install -y --no-install-recommends \
205`# Php dependencies` \
206 php \
207 php-cli \
208 php-dev \
James E. King IIIe53d23c2019-02-10 11:13:23 -0500209 php-json \
James E. King IIIf5f430d2018-06-08 03:37:55 +0000210 php-pear \
211 re2c \
212 composer
213
214RUN apt-get install -y --no-install-recommends \
215`# Python dependencies` \
216 python-all \
217 python-all-dbg \
218 python-all-dev \
219 python-ipaddress \
220 python-pip \
221 python-setuptools \
222 python-six \
223 python-tornado \
224 python-twisted \
225 python-wheel \
226 python-zope.interface && \
227 pip install --upgrade backports.ssl_match_hostname
228
229RUN apt-get install -y --no-install-recommends \
230`# Python3 dependencies` \
231 python3-all \
232 python3-all-dbg \
233 python3-all-dev \
234 python3-pip \
235 python3-setuptools \
236 python3-six \
237 python3-tornado \
238 python3-twisted \
239 python3-wheel \
240 python3-zope.interface
241
242RUN apt-get install -y --no-install-recommends \
243`# Ruby dependencies` \
244 ruby \
245 ruby-dev \
246 ruby-bundler
247
Danny Browning181d9002019-04-15 09:50:24 -0600248# Rust dependencies
Allen Georgeb0d14132020-03-29 11:48:55 -0400249RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.40.0 -y
James E. King III93ff9b02019-06-21 17:50:34 -0400250ENV PATH /root/.cargo/bin:$PATH
James E. King IIIf5f430d2018-06-08 03:37:55 +0000251
James E. King IIIa3a7c6c2018-12-31 17:17:34 -0500252# Swift on Linux for cross tests
253RUN cd / && \
Jano Svitok2e115772020-03-06 09:01:43 +0100254 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 && \
255 tar xf swift-5.1.4-RELEASE-ubuntu18.04.tar.gz --strip-components=1 && \
256 rm swift-5.1.4-RELEASE-ubuntu18.04.tar.gz && \
James E. King IIIa3a7c6c2018-12-31 17:17:34 -0500257 swift --version
258
ubuntu323f0322021-05-31 19:08:05 +0530259# Locale(s) for cpp unit tests
260RUN apt-get install -y --no-install-recommends \
261`# Locale dependencies` \
262 locales && \
263 locale-gen en_US.UTF-8 && \
ubuntuad76a182021-06-07 08:21:05 +0530264 locale-gen de_DE.UTF-8 && \
ubuntu323f0322021-05-31 19:08:05 +0530265 update-locale
266
James E. King IIIf5f430d2018-06-08 03:37:55 +0000267# cppcheck-1.82 has a nasty cpp parser bug, so we're using something newer
268RUN apt-get install -y --no-install-recommends \
269`# Static Code Analysis dependencies` \
270 cppcheck \
271 sloccount && \
272 pip install flake8 && \
273 wget -q "https://launchpad.net/ubuntu/+source/cppcheck/1.83-2/+build/14874703/+files/cppcheck_1.83-2_amd64.deb" && \
274 dpkg -i cppcheck_1.83-2_amd64.deb && \
275 rm cppcheck_1.83-2_amd64.deb
276
277# Clean up
278RUN rm -rf /var/cache/apt/* && \
279 rm -rf /var/lib/apt/lists/* && \
280 rm -rf /tmp/* && \
281 rm -rf /var/tmp/*
282
283ENV THRIFT_ROOT /thrift
284RUN mkdir -p $THRIFT_ROOT/src
285COPY Dockerfile $THRIFT_ROOT/
286WORKDIR $THRIFT_ROOT/src