blob: 95a2c780b73892ea386e9745b06e764877e4f06c [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
92RUN apt-get install -y --no-install-recommends \
93`# csharp (mono) dependencies` \
94 mono-devel
95
96ENV SBCL_VERSION 1.5.3
97RUN \
98`# Common Lisp (sbcl) dependencies` \
99 curl --version && \
100 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# && \
101 tar xjf sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2 && \
102 cd sbcl-${SBCL_VERSION}-x86-64-linux && \
103 ./install.sh && \
104 sbcl --version && \
105 cd .. && \
106 rm -rf sbcl*
107
108ENV D_VERSION 2.087.0
109ENV DMD_DEB dmd_2.087.0-0_amd64.deb
110RUN \
111`# D dependencies` \
112 wget -q http://downloads.dlang.org/releases/2.x/${D_VERSION}/${DMD_DEB} && \
113 dpkg --install ${DMD_DEB} && \
114 rm -f ${DMD_DEB} && \
115 mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
116 git clone -b 'v2.0.2+2.0.16' https://github.com/D-Programming-Deimos/libevent.git deimos-libevent-2.0 && \
117 mv deimos-libevent-2.0/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
118 mv deimos-libevent-2.0/C/* /usr/include/dmd/druntime/import/C/ && \
119 rm -rf deimos-libevent-2.0 && \
120 git clone -b 'v2.0.0+1.1.0h' https://github.com/D-Programming-Deimos/openssl.git deimos-openssl-1.1.0h && \
121 mv deimos-openssl-1.1.0h/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
122 mv deimos-openssl-1.1.0h/C/* /usr/include/dmd/druntime/import/C/ && \
123 rm -rf deimos-openssl-1.1.0h
124
125ENV DART_VERSION 2.4.0-1
126RUN apt-get install -y --no-install-recommends \
127 `# Dart dependencies` \
128 dart=$DART_VERSION
129ENV PATH /usr/lib/dart/bin:$PATH
130
131RUN apt-get install -y --no-install-recommends \
132`# dotnet core dependencies` \
Jens Geyerffb97e12019-12-06 23:43:08 +0100133 dotnet-sdk-3.1
James E. King III90a04462019-07-23 22:50:28 -0400134
135RUN apt-get install -y --no-install-recommends \
136`# Erlang dependencies` \
137 erlang && \
138 wget https://s3.amazonaws.com/rebar3/rebar3 -O /usr/bin/rebar3 && \
139 chmod 755 /usr/bin/rebar3 && \
140 rebar3 --version
141
142RUN apt-get install -y --no-install-recommends \
143`# GlibC dependencies` \
144 libglib2.0-dev
145
146# golang
147ENV GOLANG_VERSION 1.12.6
148ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
149ENV GOLANG_DOWNLOAD_SHA256 dbcf71a3c1ea53b8d54ef1b48c85a39a6c9a935d01fc8291ff2b92028e59913c
150RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \
151 echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \
152 tar -C /usr/local -xzf golang.tar.gz && \
153 ln -s /usr/local/go/bin/go /usr/local/bin && \
154 rm golang.tar.gz
155
156RUN apt-get install -y --no-install-recommends \
157`# Haskell dependencies` \
158 ghc \
159 cabal-install
160
161RUN apt-get install -y --no-install-recommends \
162`# Haxe dependencies` \
163 haxe \
164 neko \
165 neko-dev && \
166 haxelib setup --always /usr/share/haxe/lib && \
167 haxelib install --always hxcpp 2>&1 > /dev/null
168
169RUN apt-get install -y --no-install-recommends \
170`# Java dependencies` \
171 ant \
172 ant-optional \
173 maven \
174 openjdk-11-jdk-headless
175
176RUN apt-get install -y --no-install-recommends \
177`# Lua dependencies` \
178 lua5.2 \
179 lua5.2-dev
180# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
181# lua5.3 does not install alternatives!
182# need to update our luasocket code, lua doesn't have luaL_openlib any more
183
184RUN apt-get install -y --no-install-recommends \
185`# Node.js dependencies` \
186 nodejs
187
188# Test dependencies for running puppeteer
189RUN apt-get install -y --no-install-recommends \
190`# JS dependencies` \
191 libxss1
192
193# does not work on disco?
194# RUN apt-get install -y --no-install-recommends \
195# `# OCaml dependencies` \
196# ocaml \
197# opam && \
198# opam init --yes && \
199# opam install --yes oasis
200
201RUN apt-get install -y --no-install-recommends \
202`# Perl dependencies` \
203 libbit-vector-perl \
204 libclass-accessor-class-perl \
205 libcrypt-ssleay-perl \
206 libio-socket-ssl-perl \
207 libnet-ssleay-perl
208
209RUN apt-get install -y --no-install-recommends \
210`# Php dependencies` \
211 php \
212 php-cli \
213 php-dev \
214 php-json \
215 php-pear \
216 re2c \
217 composer
218
219RUN apt-get install -y --no-install-recommends \
220`# Python dependencies` \
221 python-all \
222 python-all-dbg \
223 python-all-dev \
224 python-ipaddress \
225 python-pip \
226 python-setuptools \
227 python-six \
228 python-tornado \
229 python-twisted \
230 python-wheel \
231 python-zope.interface && \
232 pip install --upgrade backports.ssl_match_hostname
233
234RUN apt-get install -y --no-install-recommends \
235`# Python3 dependencies` \
236 python3-all \
237 python3-all-dbg \
238 python3-all-dev \
239 python3-pip \
240 python3-setuptools \
241 python3-six \
242 python3-tornado \
243 python3-twisted \
244 python3-wheel \
245 python3-zope.interface
246
247RUN apt-get install -y --no-install-recommends \
248`# Ruby dependencies` \
249 ruby \
250 ruby-dev \
251 ruby-bundler
252
253# Rust dependencies
254RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.35.0 -y
255ENV PATH /root/.cargo/bin:$PATH
256
257# Swift on Linux for cross tests
258# does not work on disco
259# RUN cd / && \
260# 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 && \
261# tar xf swift-4.2.1-RELEASE-ubuntu18.04.tar.gz --strip-components=1 && \
262# rm swift-4.2.1-RELEASE-ubuntu18.04.tar.gz && \
263# swift --version
264
265# 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