blob: a175ed5551f5acc5727a02124eb6618effcca206 [file] [log] [blame]
James E. King III90a04462019-07-23 22:50:28 -04001# 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 Disco
15# with some updated packages.
16#
17
18FROM buildpack-deps:disco-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 && \
26 apt-get install -y --no-install-recommends \
27 apt \
28 apt-transport-https \
29 apt-utils \
30 curl \
31 dirmngr \
32 software-properties-common \
33 wget
34
35# 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# 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 disco contrib" | tee /etc/apt/sources.list.d/erlang.list
49
50# node.js
51RUN curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
52 echo "deb https://deb.nodesource.com/node_10.x disco main" | tee /etc/apt/sources.list.d/nodesource.list
53
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 \
65 libasound2 \
66 libatk-bridge2.0-0 \
67 libgtk-3-0 \
68 llvm \
69 ninja-build \
70 pkg-config \
71 unzip \
72 valgrind \
73 vim
74ENV PATH /usr/lib/llvm-6.0/bin:$PATH
75
76# 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
83RUN 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 III90a04462019-07-23 22:50:28 -040092ENV SBCL_VERSION 1.5.3
93RUN \
94`# Common Lisp (sbcl) dependencies` \
95 curl --version && \
96 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# && \
97 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
104ENV D_VERSION 2.087.0
105ENV DMD_DEB dmd_2.087.0-0_amd64.deb
106RUN \
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 && \
112 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 && \
116 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
120
aaronstgeorge-wf1ab156a2020-10-01 17:28:28 +0200121ENV DART_VERSION 2.7.2-1
James E. King III90a04462019-07-23 22:50:28 -0400122RUN apt-get install -y --no-install-recommends \
123 `# Dart dependencies` \
124 dart=$DART_VERSION
125ENV PATH /usr/lib/dart/bin:$PATH
126
127RUN apt-get install -y --no-install-recommends \
128`# dotnet core dependencies` \
Jens Geyer526a1ac2021-02-13 13:58:09 +0100129 dotnet-sdk-5.0
James E. King III90a04462019-07-23 22:50:28 -0400130
131RUN apt-get install -y --no-install-recommends \
132`# Erlang dependencies` \
133 erlang && \
134 wget https://s3.amazonaws.com/rebar3/rebar3 -O /usr/bin/rebar3 && \
135 chmod 755 /usr/bin/rebar3 && \
136 rebar3 --version
137
138RUN apt-get install -y --no-install-recommends \
139`# GlibC dependencies` \
140 libglib2.0-dev
141
142# golang
Yuxuan 'fishy' Wangb71f11e2021-03-22 15:01:00 -0700143ENV GOLANG_VERSION 1.16.2
James E. King III90a04462019-07-23 22:50:28 -0400144ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
Yuxuan 'fishy' Wangb71f11e2021-03-22 15:01:00 -0700145ENV GOLANG_DOWNLOAD_SHA256 542e936b19542e62679766194364f45141fde55169db2d8d01046555ca9eb4b8
James E. King III90a04462019-07-23 22:50:28 -0400146RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \
147 echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \
148 tar -C /usr/local -xzf golang.tar.gz && \
149 ln -s /usr/local/go/bin/go /usr/local/bin && \
150 rm golang.tar.gz
151
152RUN apt-get install -y --no-install-recommends \
James E. King III90a04462019-07-23 22:50:28 -0400153`# Haxe dependencies` \
154 haxe \
155 neko \
156 neko-dev && \
157 haxelib setup --always /usr/share/haxe/lib && \
158 haxelib install --always hxcpp 2>&1 > /dev/null
159
160RUN apt-get install -y --no-install-recommends \
161`# Java dependencies` \
162 ant \
163 ant-optional \
164 maven \
165 openjdk-11-jdk-headless
166
167RUN apt-get install -y --no-install-recommends \
168`# Lua dependencies` \
169 lua5.2 \
170 lua5.2-dev
171# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
172# lua5.3 does not install alternatives!
173# need to update our luasocket code, lua doesn't have luaL_openlib any more
174
175RUN apt-get install -y --no-install-recommends \
176`# Node.js dependencies` \
177 nodejs
178
179# Test dependencies for running puppeteer
180RUN apt-get install -y --no-install-recommends \
181`# JS dependencies` \
Yuxuan 'fishy' Wang0f735582021-04-28 08:33:36 -0700182 libxss1 \
183 libxtst6
James E. King III90a04462019-07-23 22:50:28 -0400184
185# does not work on disco?
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
192
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 III90a04462019-07-23 22:50:28 -0400201
202RUN apt-get install -y --no-install-recommends \
203`# Php dependencies` \
204 php \
205 php-cli \
206 php-dev \
207 php-json \
208 php-pear \
209 re2c \
210 composer
211
212RUN apt-get install -y --no-install-recommends \
213`# Python dependencies` \
214 python-all \
215 python-all-dbg \
216 python-all-dev \
217 python-ipaddress \
218 python-pip \
219 python-setuptools \
220 python-six \
221 python-tornado \
222 python-twisted \
223 python-wheel \
224 python-zope.interface && \
225 pip install --upgrade backports.ssl_match_hostname
226
227RUN apt-get install -y --no-install-recommends \
228`# Python3 dependencies` \
229 python3-all \
230 python3-all-dbg \
231 python3-all-dev \
232 python3-pip \
233 python3-setuptools \
234 python3-six \
235 python3-tornado \
236 python3-twisted \
237 python3-wheel \
238 python3-zope.interface
239
240RUN apt-get install -y --no-install-recommends \
241`# Ruby dependencies` \
242 ruby \
243 ruby-dev \
244 ruby-bundler
245
246# Rust dependencies
Allen Georgeb0d14132020-03-29 11:48:55 -0400247RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.40.0 -y
James E. King III90a04462019-07-23 22:50:28 -0400248ENV PATH /root/.cargo/bin:$PATH
249
250# Swift on Linux for cross tests
251# does not work on disco
252# RUN cd / && \
253# wget --quiet https://swift.org/builds/swift-4.2.1-release/ubuntu1804/swift-4.2.1-RELEASE/swift-4.2.1-RELEASE-ubuntu18.04.tar.gz && \
254# tar xf swift-4.2.1-RELEASE-ubuntu18.04.tar.gz --strip-components=1 && \
255# rm swift-4.2.1-RELEASE-ubuntu18.04.tar.gz && \
256# swift --version
257
ubuntu323f0322021-05-31 19:08:05 +0530258# Locale(s) for cpp unit tests
259RUN apt-get install -y --no-install-recommends \
260`# Locale dependencies` \
261 locales && \
262 locale-gen en_US.UTF-8 && \
263 update-locale
264
James E. King III90a04462019-07-23 22:50:28 -0400265# cppcheck-1.82 has a nasty cpp parser bug, so we're using something newer
266# don't need this on disco, nobody uses it
267# RUN apt-get install -y --no-install-recommends \
268# `# Static Code Analysis dependencies` \
269# cppcheck \
270# sloccount && \
271# pip install flake8 && \
272# wget -q "https://launchpad.net/ubuntu/+source/cppcheck/1.83-2/+build/14874703/+files/cppcheck_1.83-2_amd64.deb" && \
273# dpkg -i cppcheck_1.83-2_amd64.deb && \
274# rm cppcheck_1.83-2_amd64.deb
275
276# Clean up
277RUN rm -rf /var/cache/apt/* && \
278 rm -rf /var/lib/apt/lists/* && \
279 rm -rf /tmp/* && \
280 rm -rf /var/tmp/*
281
282ENV THRIFT_ROOT /thrift
283RUN mkdir -p $THRIFT_ROOT/src
284COPY Dockerfile $THRIFT_ROOT/
285WORKDIR $THRIFT_ROOT/src