blob: 134d3ef5604dd2dd5817e643ff823e70028cddde [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' Wang8045d822022-04-19 14:31:39 -0700135ENV GOLANG_VERSION 1.18.1
Yuxuan 'fishy' Wangbbc7c5f2022-01-10 11:44:23 -0800136ENV GOLANG_DOWNLOAD_URL https://go.dev/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
Yuxuan 'fishy' Wang8045d822022-04-19 14:31:39 -0700137ENV GOLANG_DOWNLOAD_SHA256 b3b815f47ababac13810fc6021eb73d65478e0b2db4b09d348eefad9581a2334
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
Jiayu Liu5d220eb2022-04-19 04:18:58 +0200152ENV GRADLE_VERSION="6.9.2"
James E. King IIIf5f430d2018-06-08 03:37:55 +0000153RUN apt-get install -y --no-install-recommends \
154`# Java dependencies` \
155 ant \
156 ant-optional \
Fokko Driesprong1686c872019-02-01 20:31:58 +0100157 maven \
Jiayu Liu5d220eb2022-04-19 04:18:58 +0200158 openjdk-11-jdk-headless && \
159`# Gradle` \
160 wget https://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip -q -O /tmp/gradle-$GRADLE_VERSION-bin.zip && \
161 (echo "8b356fd8702d5ffa2e066ed0be45a023a779bba4dd1a68fd11bc2a6bdc981e8f /tmp/gradle-$GRADLE_VERSION-bin.zip" | sha256sum -c -) && \
162 unzip -d /tmp /tmp/gradle-$GRADLE_VERSION-bin.zip && \
163 mv /tmp/gradle-$GRADLE_VERSION /usr/local/gradle && \
164 ln -s /usr/local/gradle/bin/gradle /usr/local/bin
James E. King IIIf5f430d2018-06-08 03:37:55 +0000165
166RUN apt-get install -y --no-install-recommends \
167`# Lua dependencies` \
168 lua5.2 \
169 lua5.2-dev
170# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
171# lua5.3 does not install alternatives!
172# need to update our luasocket code, lua doesn't have luaL_openlib any more
173
174RUN apt-get install -y --no-install-recommends \
175`# Node.js dependencies` \
176 nodejs
177
Brian Forbisb5d6ea32018-08-25 23:39:29 -0400178# Test dependencies for running puppeteer
179RUN apt-get install -y --no-install-recommends \
180`# JS dependencies` \
Yuxuan 'fishy' Wang0f735582021-04-28 08:33:36 -0700181 libxss1 \
182 libxtst6
Brian Forbisb5d6ea32018-08-25 23:39:29 -0400183
James E. King IIIf5f430d2018-06-08 03:37:55 +0000184RUN 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 IIIf5f430d2018-06-08 03:37:55 +0000199
200RUN apt-get install -y --no-install-recommends \
201`# Php dependencies` \
202 php \
203 php-cli \
204 php-dev \
James E. King IIIe53d23c2019-02-10 11:13:23 -0500205 php-json \
James E. King IIIf5f430d2018-06-08 03:37:55 +0000206 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
Danny Browning181d9002019-04-15 09:50:24 -0600244# 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 III93ff9b02019-06-21 17:50:34 -0400246ENV PATH /root/.cargo/bin:$PATH
James E. King IIIf5f430d2018-06-08 03:37:55 +0000247
James E. King IIIa3a7c6c2018-12-31 17:17:34 -0500248# Swift on Linux for cross tests
249RUN cd / && \
Jano Svitok2e115772020-03-06 09:01:43 +0100250 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 && \
251 tar xf swift-5.1.4-RELEASE-ubuntu18.04.tar.gz --strip-components=1 && \
252 rm swift-5.1.4-RELEASE-ubuntu18.04.tar.gz && \
James E. King IIIa3a7c6c2018-12-31 17:17:34 -0500253 swift --version
254
ubuntu323f0322021-05-31 19:08:05 +0530255# Locale(s) for cpp unit tests
256RUN apt-get install -y --no-install-recommends \
257`# Locale dependencies` \
258 locales && \
259 locale-gen en_US.UTF-8 && \
ubuntuad76a182021-06-07 08:21:05 +0530260 locale-gen de_DE.UTF-8 && \
ubuntu323f0322021-05-31 19:08:05 +0530261 update-locale
262
James E. King IIIf5f430d2018-06-08 03:37:55 +0000263# cppcheck-1.82 has a nasty cpp parser bug, so we're using something newer
264RUN apt-get install -y --no-install-recommends \
265`# Static Code Analysis dependencies` \
266 cppcheck \
267 sloccount && \
268 pip install flake8 && \
269 wget -q "https://launchpad.net/ubuntu/+source/cppcheck/1.83-2/+build/14874703/+files/cppcheck_1.83-2_amd64.deb" && \
270 dpkg -i cppcheck_1.83-2_amd64.deb && \
271 rm cppcheck_1.83-2_amd64.deb
272
Aki Sukegawa7594da82022-03-07 00:28:26 -0500273# NOTE: this does not reduce the image size but adds an additional layer.
274# # Clean up
275# RUN rm -rf /var/cache/apt/* && \
276# rm -rf /var/lib/apt/lists/* && \
277# rm -rf /tmp/* && \
278# rm -rf /var/tmp/*
James E. King IIIf5f430d2018-06-08 03:37:55 +0000279
280ENV THRIFT_ROOT /thrift
281RUN mkdir -p $THRIFT_ROOT/src
282COPY Dockerfile $THRIFT_ROOT/
283WORKDIR $THRIFT_ROOT/src