blob: c69bec29b118845be4a352d64d846982338c59bd [file] [log] [blame]
James E. King, IIIb66b66f2017-08-31 18:07:40 -07001# 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
James E. King, III0ad20bd2017-09-30 15:44:16 -070013#
James E. King, IIIb66b66f2017-08-31 18:07:40 -070014# Apache Thrift Docker build environment for Ubuntu Xenial
James E. King, III0ad20bd2017-09-30 15:44:16 -070015# Using all stock Ubuntu Xenial packaging except for:
James E. King IIIb92ca5f2018-06-09 23:02:12 -040016# - d: does not come with Ubuntu so we're installing 2.075.1 for coverage
James E. King, III0ad20bd2017-09-30 15:44:16 -070017# - dart: does not come with Ubuntu so we're installing 1.22.1 for coverage
John Boiles57852792018-01-05 14:37:05 -080018# - dotnet: does not come with Ubuntu
19# - go: Xenial comes with 1.6, but we need 1.7 or later
20# - nodejs: Xenial comes with 4.2.6 which exits LTS April 2018, so we're installing 6.x
James E. King IIIa02ae562018-03-12 15:27:23 -040021# - ocaml: causes stack overflow error, just started March 2018 not sure why
James E. King, III0ad20bd2017-09-30 15:44:16 -070022#
23
James E. King, IIIb66b66f2017-08-31 18:07:40 -070024FROM buildpack-deps:xenial-scm
25MAINTAINER Apache Thrift <dev@thrift.apache.org>
James E. King, IIIb66b66f2017-08-31 18:07:40 -070026ENV DEBIAN_FRONTEND noninteractive
27
James E. King, IIId7142b72017-09-01 13:00:36 -070028### Add apt repos
James E. King, IIIb66b66f2017-08-31 18:07:40 -070029
Robert Lu31d5b7b2018-01-05 13:44:38 +080030RUN apt-get update && \
31 apt-get dist-upgrade -y && \
32 apt-get install -y --no-install-recommends \
33 apt \
34 apt-transport-https \
35 apt-utils \
36 curl \
James E. King IIIad238522018-01-13 19:52:31 -050037 software-properties-common \
Robert Lu31d5b7b2018-01-05 13:44:38 +080038 wget
James E. King, IIIb66b66f2017-08-31 18:07:40 -070039
James E. King, IIIf4543692017-09-01 05:23:29 -070040# csharp (mono)
James E. King, III0ad20bd2017-09-30 15:44:16 -070041# RUN echo "deb http://download.mono-project.com/repo/debian xenial main" | tee /etc/apt/sources.list.d/mono.list && \
42# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A6A19B38D3D831EF
James E. King, IIIb66b66f2017-08-31 18:07:40 -070043
44# D
James E. King IIIad238522018-01-13 19:52:31 -050045RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EBCF975E5BA24D5E && \
46 wget http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list && \
James E. King, III0ad20bd2017-09-30 15:44:16 -070047 wget -qO - https://dlang.org/d-keyring.gpg | apt-key add -
James E. King, IIIb66b66f2017-08-31 18:07:40 -070048
49# Dart
50RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
Robert Lu31d5b7b2018-01-05 13:44:38 +080051 curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > \
52 /etc/apt/sources.list.d/dart_stable.list
James E. King IIIad238522018-01-13 19:52:31 -050053ENV DART_VERSION 1.22.1-1
James E. King, IIIb66b66f2017-08-31 18:07:40 -070054
James E. King, III6e883f92017-11-18 21:18:05 -050055# dotnet (core)
James E. King, IIIb6287362017-09-28 11:57:42 +000056RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \
Robert Lu31d5b7b2018-01-05 13:44:38 +080057 echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > \
58 /etc/apt/sources.list.d/dotnetdev.list
James E. King, IIId7142b72017-09-01 13:00:36 -070059
James E. King IIIa37feaf2018-03-06 15:11:01 -050060# node.js
61RUN curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
62 echo "deb https://deb.nodesource.com/node_6.x xenial main" | tee /etc/apt/sources.list.d/nodesource.list
63
James E. King, IIId7142b72017-09-01 13:00:36 -070064### install general dependencies
James E. King, III0ad20bd2017-09-30 15:44:16 -070065RUN apt-get update && apt-get install -y --no-install-recommends \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070066`# General dependencies` \
James E. King, IIIf4543692017-09-01 05:23:29 -070067 bash-completion \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070068 bison \
69 build-essential \
70 clang \
71 cmake \
72 debhelper \
73 flex \
James E. King, IIId7142b72017-09-01 13:00:36 -070074 gdb \
75 llvm \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070076 ninja-build \
77 pkg-config \
James E. King, III7d211b82017-09-06 10:12:02 -070078 valgrind \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070079 vim
James E. King, IIId7142b72017-09-01 13:00:36 -070080ENV PATH /usr/lib/llvm-3.8/bin:$PATH
James E. King, IIIb66b66f2017-08-31 18:07:40 -070081
James E. King, IIId7142b72017-09-01 13:00:36 -070082### languages
James E. King, IIIb66b66f2017-08-31 18:07:40 -070083
84RUN apt-get install -y --no-install-recommends \
85`# C++ dependencies` \
86 libboost-dev \
87 libboost-filesystem-dev \
88 libboost-program-options-dev \
89 libboost-system-dev \
90 libboost-test-dev \
91 libboost-thread-dev \
92 libevent-dev \
93 libssl-dev \
94 qt5-default \
95 qtbase5-dev \
96 qtbase5-dev-tools
97
98RUN apt-get install -y --no-install-recommends \
James E. King, IIIf4543692017-09-01 05:23:29 -070099`# csharp (mono) dependencies` \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700100 mono-devel
101
James E. King IIIb92ca5f2018-06-09 23:02:12 -0400102ENV D_VERSION 2.075.1-0
James E. King, III0ad20bd2017-09-30 15:44:16 -0700103RUN apt-get install -y --allow-unauthenticated --no-install-recommends \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700104`# D dependencies` \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700105 dmd-bin=$D_VERSION \
106 libphobos2-dev=$D_VERSION \
James E. King IIIb92ca5f2018-06-09 23:02:12 -0400107 dub=1.6.0-0 \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700108 dfmt \
109 dscanner \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700110 libevent-dev \
111 libssl-dev \
112 xdg-utils
James E. King IIIf338d572018-01-29 14:51:24 -0500113RUN mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
114 curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
115 mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
116 mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \
117 rm -rf libevent-master
118RUN curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
119 mv openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
120 mv openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
121 rm -rf openssl-master
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700122
123RUN apt-get install -y --no-install-recommends \
124`# Dart dependencies` \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700125 dart=$DART_VERSION
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700126ENV PATH /usr/lib/dart/bin:$PATH
127
James E. King, IIIb6287362017-09-28 11:57:42 +0000128RUN apt-get install -y --no-install-recommends \
129`# dotnet core dependencies` \
James E. King IIIf338d572018-01-29 14:51:24 -0500130 dotnet-sdk-2.1.4
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700131
132RUN apt-get install -y --no-install-recommends \
133`# Erlang dependencies` \
134 erlang-base \
135 erlang-eunit \
136 erlang-dev \
137 erlang-tools \
138 rebar
139
140RUN apt-get install -y --no-install-recommends \
141`# GlibC dependencies` \
142 libglib2.0-dev
143
John Boiles57852792018-01-05 14:37:05 -0800144# golang
145ENV GOLANG_VERSION 1.7.6
146ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
147ENV GOLANG_DOWNLOAD_SHA256 ad5808bf42b014c22dd7646458f631385003049ded0bb6af2efc7f1f79fa29ea
148RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \
149 echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \
150 tar -C /usr/local -xzf golang.tar.gz && \
151 ln -s /usr/local/go/bin/go /usr/local/bin && \
152 rm golang.tar.gz
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700153
James E. King IIIf74bc7b2018-09-14 17:56:49 +0000154# due to a bug in cabal in xenial (cabal-install package) we pull in another:
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700155RUN apt-get install -y --no-install-recommends \
156`# Haskell dependencies` \
James E. King IIIf74bc7b2018-09-14 17:56:49 +0000157 ghc && \
158 cd /tmp && \
159 wget -q https://www.haskell.org/cabal/release/cabal-install-1.24.0.2/cabal-install-1.24.0.2-x86_64-unknown-linux.tar.gz && \
160 tar xzf cabal-install-1.24.0.2-x86_64-unknown-linux.tar.gz && \
161 find dist-newstyle/ -type f -name cabal -exec mv {} /usr/bin \; && \
162 rm -rf /tmp/cabal* && \
163 cabal --version
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700164
165RUN apt-get install -y --no-install-recommends \
166`# Haxe dependencies` \
167 haxe \
168 neko \
169 neko-dev \
James E. King IIIad238522018-01-13 19:52:31 -0500170 libneko0 && \
171 haxelib setup --always /usr/share/haxe/lib && \
James E. King IIIf64a3fc2018-01-14 08:54:25 -0500172 haxelib install --always hxcpp 3.4.64 2>&1 > /dev/null
James E. King, III81cdcd32017-09-09 17:54:10 +0000173# note: hxcpp 3.4.185 (latest) no longer ships static libraries, and caused a build failure
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700174
175RUN apt-get install -y --no-install-recommends \
176`# Java dependencies` \
177 ant \
178 ant-optional \
179 openjdk-8-jdk \
180 maven
181
182RUN apt-get install -y --no-install-recommends \
183`# Lua dependencies` \
James E. King, IIId7142b72017-09-01 13:00:36 -0700184 lua5.2 \
185 lua5.2-dev
186# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
187# lua5.3 does not install alternatives so stick with 5.2 here
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700188
189RUN apt-get install -y --no-install-recommends \
190`# Node.js dependencies` \
James E. King IIIa37feaf2018-03-06 15:11:01 -0500191 nodejs
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700192
James E. King IIIa02ae562018-03-12 15:27:23 -0400193# THRIFT-4517: causes stack overflows; version too old; skip ocaml in xenial
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
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700200
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 php7.0 \
212 php7.0-cli \
213 php7.0-dev \
214 php-pear \
215 re2c \
Robert Lua15060a2017-12-28 15:29:39 +0800216 composer
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700217
218RUN apt-get install -y --no-install-recommends \
219`# Python dependencies` \
220 python-all \
221 python-all-dbg \
222 python-all-dev \
223 python-backports.ssl-match-hostname \
224 python-ipaddress \
225 python-pip \
226 python-setuptools \
James E. King, IIId7142b72017-09-01 13:00:36 -0700227 python-six \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700228 python-tornado \
229 python-twisted \
James E. King, IIId7142b72017-09-01 13:00:36 -0700230 python-wheel \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700231 python-zope.interface \
232 python3-all \
233 python3-all-dbg \
234 python3-all-dev \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700235 python3-setuptools \
James E. King, IIId7142b72017-09-01 13:00:36 -0700236 python3-six \
237 python3-tornado \
238 python3-twisted \
239 python3-wheel \
240 python3-zope.interface && \
241 pip install --upgrade backports.ssl_match_hostname
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700242
243RUN apt-get install -y --no-install-recommends \
244`# Ruby dependencies` \
245 ruby \
246 ruby-dev \
247 ruby-bundler
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700248
249RUN apt-get install -y --no-install-recommends \
250`# Rust dependencies` \
251 cargo \
252 rustc
253
James E. King, IIId7142b72017-09-01 13:00:36 -0700254# Clean up
255RUN rm -rf /var/cache/apt/* && \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700256 rm -rf /var/lib/apt/lists/* && \
257 rm -rf /tmp/* && \
258 rm -rf /var/tmp/*
259
James E. King, IIIb6287362017-09-28 11:57:42 +0000260ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700261ENV THRIFT_ROOT /thrift
262RUN mkdir -p $THRIFT_ROOT/src
263COPY Dockerfile $THRIFT_ROOT/
264WORKDIR $THRIFT_ROOT/src