blob: ee3f19ff4d1e384f6caf992a0406a69825726566 [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 D_VERSION 2.087.0
93ENV DMD_DEB dmd_2.087.0-0_amd64.deb
94RUN \
95`# D dependencies` \
96 wget -q http://downloads.dlang.org/releases/2.x/${D_VERSION}/${DMD_DEB} && \
97 dpkg --install ${DMD_DEB} && \
98 rm -f ${DMD_DEB} && \
99 mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
100 git clone -b 'v2.0.2+2.0.16' https://github.com/D-Programming-Deimos/libevent.git deimos-libevent-2.0 && \
101 mv deimos-libevent-2.0/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
102 mv deimos-libevent-2.0/C/* /usr/include/dmd/druntime/import/C/ && \
103 rm -rf deimos-libevent-2.0 && \
104 git clone -b 'v2.0.0+1.1.0h' https://github.com/D-Programming-Deimos/openssl.git deimos-openssl-1.1.0h && \
105 mv deimos-openssl-1.1.0h/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
106 mv deimos-openssl-1.1.0h/C/* /usr/include/dmd/druntime/import/C/ && \
107 rm -rf deimos-openssl-1.1.0h
108
aaronstgeorge-wf1ab156a2020-10-01 17:28:28 +0200109ENV DART_VERSION 2.7.2-1
James E. King III90a04462019-07-23 22:50:28 -0400110RUN apt-get install -y --no-install-recommends \
Mario Emmenlauer96ed7272021-08-30 10:54:39 +0200111`# Dart dependencies` \
James E. King III90a04462019-07-23 22:50:28 -0400112 dart=$DART_VERSION
113ENV PATH /usr/lib/dart/bin:$PATH
114
115RUN apt-get install -y --no-install-recommends \
116`# dotnet core dependencies` \
Jens Geyer4c7b9fd2021-12-04 22:48:37 +0100117 dotnet-sdk-6.0 \
118 dotnet-runtime-6.0 \
119 aspnetcore-runtime-6.0 \
120 dotnet-apphost-pack-6.0
James E. King III90a04462019-07-23 22:50:28 -0400121
122RUN apt-get install -y --no-install-recommends \
123`# Erlang dependencies` \
124 erlang && \
125 wget https://s3.amazonaws.com/rebar3/rebar3 -O /usr/bin/rebar3 && \
126 chmod 755 /usr/bin/rebar3 && \
127 rebar3 --version
128
129RUN apt-get install -y --no-install-recommends \
130`# GlibC dependencies` \
131 libglib2.0-dev
132
133# golang
Yuxuan 'fishy' Wang3f9b7d02022-08-02 11:31:14 -0700134ENV GOLANG_VERSION 1.19
Yuxuan 'fishy' Wangbbc7c5f2022-01-10 11:44:23 -0800135ENV GOLANG_DOWNLOAD_URL https://go.dev/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
Yuxuan 'fishy' Wang3f9b7d02022-08-02 11:31:14 -0700136ENV GOLANG_DOWNLOAD_SHA256 464b6b66591f6cf055bc5df90a9750bf5fbc9d038722bb84a9d56a2bea974be6
James E. King III90a04462019-07-23 22:50:28 -0400137RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \
138 echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \
139 tar -C /usr/local -xzf golang.tar.gz && \
140 ln -s /usr/local/go/bin/go /usr/local/bin && \
141 rm golang.tar.gz
142
143RUN apt-get install -y --no-install-recommends \
James E. King III90a04462019-07-23 22:50:28 -0400144`# Haxe dependencies` \
145 haxe \
146 neko \
147 neko-dev && \
148 haxelib setup --always /usr/share/haxe/lib && \
149 haxelib install --always hxcpp 2>&1 > /dev/null
150
Jiayu Liu5b158382022-05-12 00:20:37 +0800151ENV GRADLE_VERSION="7.4.2"
James E. King III90a04462019-07-23 22:50:28 -0400152RUN apt-get install -y --no-install-recommends \
153`# Java dependencies` \
154 ant \
155 ant-optional \
156 maven \
Jiayu Liu5d220eb2022-04-19 04:18:58 +0200157 openjdk-11-jdk-headless && \
158`# Gradle` \
159 wget https://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip -q -O /tmp/gradle-$GRADLE_VERSION-bin.zip && \
Jiayu Liu5b158382022-05-12 00:20:37 +0800160 (echo "29e49b10984e585d8118b7d0bc452f944e386458df27371b49b4ac1dec4b7fda /tmp/gradle-$GRADLE_VERSION-bin.zip" | sha256sum -c -) && \
Jiayu Liu5d220eb2022-04-19 04:18:58 +0200161 unzip -d /tmp /tmp/gradle-$GRADLE_VERSION-bin.zip && \
162 mv /tmp/gradle-$GRADLE_VERSION /usr/local/gradle && \
163 ln -s /usr/local/gradle/bin/gradle /usr/local/bin
James E. King III90a04462019-07-23 22:50:28 -0400164
165RUN apt-get install -y --no-install-recommends \
166`# Lua dependencies` \
167 lua5.2 \
168 lua5.2-dev
169# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
170# lua5.3 does not install alternatives!
171# need to update our luasocket code, lua doesn't have luaL_openlib any more
172
173RUN apt-get install -y --no-install-recommends \
174`# Node.js dependencies` \
175 nodejs
176
177# Test dependencies for running puppeteer
178RUN apt-get install -y --no-install-recommends \
179`# JS dependencies` \
Yuxuan 'fishy' Wang0f735582021-04-28 08:33:36 -0700180 libxss1 \
181 libxtst6
James E. King III90a04462019-07-23 22:50:28 -0400182
183# does not work on disco?
184# RUN apt-get install -y --no-install-recommends \
185# `# OCaml dependencies` \
186# ocaml \
187# opam && \
188# opam init --yes && \
189# opam install --yes oasis
190
191RUN apt-get install -y --no-install-recommends \
192`# Perl dependencies` \
193 libbit-vector-perl \
194 libclass-accessor-class-perl \
195 libcrypt-ssleay-perl \
196 libio-socket-ssl-perl \
Kengo Sekicb4c31a2019-12-26 14:34:57 +0900197 libnet-ssleay-perl \
198 libtest-exception-perl
James E. King III90a04462019-07-23 22:50:28 -0400199
200RUN apt-get install -y --no-install-recommends \
201`# Php dependencies` \
202 php \
203 php-cli \
204 php-dev \
205 php-json \
206 php-pear \
207 re2c \
208 composer
209
210RUN apt-get install -y --no-install-recommends \
211`# Python dependencies` \
212 python-all \
213 python-all-dbg \
214 python-all-dev \
215 python-ipaddress \
216 python-pip \
217 python-setuptools \
218 python-six \
219 python-tornado \
220 python-twisted \
221 python-wheel \
222 python-zope.interface && \
223 pip install --upgrade backports.ssl_match_hostname
224
225RUN apt-get install -y --no-install-recommends \
226`# Python3 dependencies` \
227 python3-all \
228 python3-all-dbg \
229 python3-all-dev \
230 python3-pip \
231 python3-setuptools \
232 python3-six \
233 python3-tornado \
234 python3-twisted \
235 python3-wheel \
236 python3-zope.interface
237
238RUN apt-get install -y --no-install-recommends \
239`# Ruby dependencies` \
240 ruby \
241 ruby-dev \
242 ruby-bundler
243
244# Rust dependencies
Allen Georgeb0d14132020-03-29 11:48:55 -0400245RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.40.0 -y
James E. King III90a04462019-07-23 22:50:28 -0400246ENV PATH /root/.cargo/bin:$PATH
247
248# Swift on Linux for cross tests
249# does not work on disco
250# RUN cd / && \
251# 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 && \
252# tar xf swift-4.2.1-RELEASE-ubuntu18.04.tar.gz --strip-components=1 && \
253# rm swift-4.2.1-RELEASE-ubuntu18.04.tar.gz && \
254# swift --version
255
ubuntu323f0322021-05-31 19:08:05 +0530256# Locale(s) for cpp unit tests
257RUN apt-get install -y --no-install-recommends \
258`# Locale dependencies` \
259 locales && \
260 locale-gen en_US.UTF-8 && \
ubuntuad76a182021-06-07 08:21:05 +0530261 locale-gen de_DE.UTF-8 && \
ubuntu323f0322021-05-31 19:08:05 +0530262 update-locale
263
James E. King III90a04462019-07-23 22:50:28 -0400264# cppcheck-1.82 has a nasty cpp parser bug, so we're using something newer
265# don't need this on disco, nobody uses it
266# RUN apt-get install -y --no-install-recommends \
267# `# Static Code Analysis dependencies` \
268# cppcheck \
269# sloccount && \
270# pip install flake8 && \
271# wget -q "https://launchpad.net/ubuntu/+source/cppcheck/1.83-2/+build/14874703/+files/cppcheck_1.83-2_amd64.deb" && \
272# dpkg -i cppcheck_1.83-2_amd64.deb && \
273# rm cppcheck_1.83-2_amd64.deb
274
275# Clean up
276RUN rm -rf /var/cache/apt/* && \
277 rm -rf /var/lib/apt/lists/* && \
278 rm -rf /tmp/* && \
279 rm -rf /var/tmp/*
280
281ENV THRIFT_ROOT /thrift
282RUN mkdir -p $THRIFT_ROOT/src
283COPY Dockerfile $THRIFT_ROOT/
284WORKDIR $THRIFT_ROOT/src