blob: 315b2986534c19eda88d8e59af3ecacc478285d6 [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 III93ff9b02019-06-21 17:50:34 -040017# - dart: does not come with Ubuntu so we're installing 2.0.0-1 for coverage
John Boiles57852792018-01-05 14:37:05 -080018# - dotnet: does not come with Ubuntu
James E. King III3b779822019-03-15 15:59:27 -040019# - go: Xenial comes with 1.6, but we need 1.10 or later
Mario Emmenlauer55680af2020-05-11 22:58:48 +020020# - nodejs: Xenial comes with 4.2.6 which exits LTS April 2018, so we're installing 10.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 \
James E. King III93ff9b02019-06-21 17:50:34 -040038 wget && \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070039
James E. King, IIIb66b66f2017-08-31 18:07:40 -070040# D
James E. King III93ff9b02019-06-21 17:50:34 -040041 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EBCF975E5BA24D5E && \
James E. King IIIad238522018-01-13 19:52:31 -050042 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 III93ff9b02019-06-21 17:50:34 -040043 wget -qO - https://dlang.org/d-keyring.gpg | apt-key add - && \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070044
45# Dart
James E. King III93ff9b02019-06-21 17:50:34 -040046 curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
Robert Lu31d5b7b2018-01-05 13:44:38 +080047 curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > \
James E. King III93ff9b02019-06-21 17:50:34 -040048 /etc/apt/sources.list.d/dart_stable.list && \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070049
James E. King, III6e883f92017-11-18 21:18:05 -050050# dotnet (core)
James E. King III93ff9b02019-06-21 17:50:34 -040051 curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \
Robert Lu31d5b7b2018-01-05 13:44:38 +080052 echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > \
James E. King III93ff9b02019-06-21 17:50:34 -040053 /etc/apt/sources.list.d/dotnetdev.list && \
James E. King, IIId7142b72017-09-01 13:00:36 -070054
James E. King IIIa37feaf2018-03-06 15:11:01 -050055# node.js
James E. King III93ff9b02019-06-21 17:50:34 -040056 curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
Mario Emmenlauer55680af2020-05-11 22:58:48 +020057 echo "deb https://deb.nodesource.com/node_10.x xenial main" | tee /etc/apt/sources.list.d/nodesource.list && \
Jano Svitok299b68e2020-03-09 23:07:30 +010058
59# ruby 2.4
60 apt-add-repository ppa:brightbox/ruby-ng
Brian Forbisb5d6ea32018-08-25 23:39:29 -040061
James E. King, IIId7142b72017-09-01 13:00:36 -070062### install general dependencies
James E. King, III0ad20bd2017-09-30 15:44:16 -070063RUN apt-get update && apt-get install -y --no-install-recommends \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070064`# General dependencies` \
James E. King, IIIf4543692017-09-01 05:23:29 -070065 bash-completion \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070066 bison \
67 build-essential \
68 clang \
69 cmake \
70 debhelper \
71 flex \
James E. King, IIId7142b72017-09-01 13:00:36 -070072 gdb \
73 llvm \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070074 ninja-build \
75 pkg-config \
James E. King, III7d211b82017-09-06 10:12:02 -070076 valgrind \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070077 vim
James E. King, IIId7142b72017-09-01 13:00:36 -070078ENV PATH /usr/lib/llvm-3.8/bin:$PATH
James E. King, IIIb66b66f2017-08-31 18:07:40 -070079
James E. King, IIId7142b72017-09-01 13:00:36 -070080### languages
James E. King, IIIb66b66f2017-08-31 18:07:40 -070081
82RUN apt-get install -y --no-install-recommends \
83`# C++ dependencies` \
84 libboost-dev \
85 libboost-filesystem-dev \
86 libboost-program-options-dev \
87 libboost-system-dev \
88 libboost-test-dev \
89 libboost-thread-dev \
90 libevent-dev \
91 libssl-dev \
92 qt5-default \
93 qtbase5-dev \
94 qtbase5-dev-tools
95
James E. King IIIb92ca5f2018-06-09 23:02:12 -040096ENV D_VERSION 2.075.1-0
James E. King, III0ad20bd2017-09-30 15:44:16 -070097RUN apt-get install -y --allow-unauthenticated --no-install-recommends \
James E. King, IIIb66b66f2017-08-31 18:07:40 -070098`# D dependencies` \
James E. King, III0ad20bd2017-09-30 15:44:16 -070099 dmd-bin=$D_VERSION \
100 libphobos2-dev=$D_VERSION \
James E. King IIIb92ca5f2018-06-09 23:02:12 -0400101 dub=1.6.0-0 \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700102 dfmt \
103 dscanner \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700104 libevent-dev \
105 libssl-dev \
106 xdg-utils
James E. King IIIf338d572018-01-29 14:51:24 -0500107RUN mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
108 curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
109 mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
110 mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \
111 rm -rf libevent-master
James E. King III98acf182018-09-26 14:34:34 +0000112RUN curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/v1.1.6+1.0.1g.tar.gz | tar xz && \
113 mv openssl-1.1.6-1.0.1g/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
114 mv openssl-1.1.6-1.0.1g/C/* /usr/include/dmd/druntime/import/C/ && \
115 rm -rf openssl-1.1.6-1.0.1g
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700116
James E. King III93ff9b02019-06-21 17:50:34 -0400117ENV DART_VERSION 2.0.0-1
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700118RUN apt-get install -y --no-install-recommends \
119`# Dart dependencies` \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700120 dart=$DART_VERSION
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700121ENV PATH /usr/lib/dart/bin:$PATH
122
James E. King, IIIb6287362017-09-28 11:57:42 +0000123RUN apt-get install -y --no-install-recommends \
124`# dotnet core dependencies` \
Jens Geyerffb97e12019-12-06 23:43:08 +0100125 dotnet-sdk-3.1
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700126
127RUN apt-get install -y --no-install-recommends \
128`# Erlang dependencies` \
129 erlang-base \
130 erlang-eunit \
131 erlang-dev \
132 erlang-tools \
133 rebar
134
135RUN apt-get install -y --no-install-recommends \
136`# GlibC dependencies` \
137 libglib2.0-dev
138
John Boiles57852792018-01-05 14:37:05 -0800139# golang
James E. King III3b779822019-03-15 15:59:27 -0400140ENV GOLANG_VERSION 1.10.8
John Boiles57852792018-01-05 14:37:05 -0800141ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
James E. King III3b779822019-03-15 15:59:27 -0400142ENV GOLANG_DOWNLOAD_SHA256 d8626fb6f9a3ab397d88c483b576be41fa81eefcec2fd18562c87626dbb3c39e
John Boiles57852792018-01-05 14:37:05 -0800143RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \
144 echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \
145 tar -C /usr/local -xzf golang.tar.gz && \
146 ln -s /usr/local/go/bin/go /usr/local/bin && \
147 rm golang.tar.gz
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700148
James E. King III93ff9b02019-06-21 17:50:34 -0400149# cabal 1.22 in xenial is too old so we grab a pre-built 1.24 binary
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700150RUN apt-get install -y --no-install-recommends \
151`# Haskell dependencies` \
James E. King IIIf74bc7b2018-09-14 17:56:49 +0000152 ghc && \
153 cd /tmp && \
154 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 && \
155 tar xzf cabal-install-1.24.0.2-x86_64-unknown-linux.tar.gz && \
156 find dist-newstyle/ -type f -name cabal -exec mv {} /usr/bin \; && \
157 rm -rf /tmp/cabal* && \
James E. King III93ff9b02019-06-21 17:50:34 -0400158 cabal --version && \
159 cabal update
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700160
161RUN apt-get install -y --no-install-recommends \
162`# Haxe dependencies` \
163 haxe \
164 neko \
165 neko-dev \
James E. King IIIad238522018-01-13 19:52:31 -0500166 libneko0 && \
167 haxelib setup --always /usr/share/haxe/lib && \
James E. King IIIf64a3fc2018-01-14 08:54:25 -0500168 haxelib install --always hxcpp 3.4.64 2>&1 > /dev/null
James E. King, III81cdcd32017-09-09 17:54:10 +0000169# 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 -0700170
171RUN apt-get install -y --no-install-recommends \
172`# Java dependencies` \
173 ant \
174 ant-optional \
175 openjdk-8-jdk \
176 maven
177
James E. King III93ff9b02019-06-21 17:50:34 -0400178# disabled: same as ubuntu-bionic jobs
179# RUN apt-get install -y --no-install-recommends \
180# `# Lua dependencies` \
181# lua5.2 \
182# lua5.2-dev
James E. King, IIId7142b72017-09-01 13:00:36 -0700183# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
184# lua5.3 does not install alternatives so stick with 5.2 here
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700185
186RUN apt-get install -y --no-install-recommends \
187`# Node.js dependencies` \
James E. King IIIa37feaf2018-03-06 15:11:01 -0500188 nodejs
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700189
Brian Forbisb5d6ea32018-08-25 23:39:29 -0400190# Test dependencies for running puppeteer
191RUN apt-get install -y --no-install-recommends \
192`# JS dependencies` \
193 libxss1 \
194 libatk-bridge2.0-0 \
195 libgtk-3-0
196
James E. King IIIa02ae562018-03-12 15:27:23 -0400197# THRIFT-4517: causes stack overflows; version too old; skip ocaml in xenial
198# RUN apt-get install -y --no-install-recommends \
199# `# OCaml dependencies` \
200# ocaml \
201# opam && \
202# opam init --yes && \
203# opam install --yes oasis
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700204
205RUN apt-get install -y --no-install-recommends \
206`# Perl dependencies` \
207 libbit-vector-perl \
208 libclass-accessor-class-perl \
209 libcrypt-ssleay-perl \
210 libio-socket-ssl-perl \
Kengo Sekicb4c31a2019-12-26 14:34:57 +0900211 libnet-ssleay-perl \
212 libtest-exception-perl
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700213
214RUN apt-get install -y --no-install-recommends \
215`# Php dependencies` \
216 php7.0 \
217 php7.0-cli \
218 php7.0-dev \
James E. King IIIe53d23c2019-02-10 11:13:23 -0500219 php-json \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700220 php-pear \
221 re2c \
Robert Lua15060a2017-12-28 15:29:39 +0800222 composer
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700223
224RUN apt-get install -y --no-install-recommends \
225`# Python dependencies` \
226 python-all \
227 python-all-dbg \
228 python-all-dev \
229 python-backports.ssl-match-hostname \
230 python-ipaddress \
231 python-pip \
232 python-setuptools \
James E. King, IIId7142b72017-09-01 13:00:36 -0700233 python-six \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700234 python-tornado \
235 python-twisted \
James E. King, IIId7142b72017-09-01 13:00:36 -0700236 python-wheel \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700237 python-zope.interface \
238 python3-all \
239 python3-all-dbg \
240 python3-all-dev \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700241 python3-setuptools \
James E. King, IIId7142b72017-09-01 13:00:36 -0700242 python3-six \
243 python3-tornado \
244 python3-twisted \
245 python3-wheel \
246 python3-zope.interface && \
247 pip install --upgrade backports.ssl_match_hostname
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700248
249RUN apt-get install -y --no-install-recommends \
250`# Ruby dependencies` \
Jano Svitok299b68e2020-03-09 23:07:30 +0100251 ruby2.4 \
252 ruby2.4-dev \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700253 ruby-bundler
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700254
Danny Browning181d9002019-04-15 09:50:24 -0600255# Rust dependencies
James E. King III93ff9b02019-06-21 17:50:34 -0400256RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.34.0 -y
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700257
James E. King, IIId7142b72017-09-01 13:00:36 -0700258# Clean up
259RUN rm -rf /var/cache/apt/* && \
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700260 rm -rf /var/lib/apt/lists/* && \
261 rm -rf /tmp/* && \
262 rm -rf /var/tmp/*
263
James E. King, IIIb6287362017-09-28 11:57:42 +0000264ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
James E. King, IIIb66b66f2017-08-31 18:07:40 -0700265ENV THRIFT_ROOT /thrift
266RUN mkdir -p $THRIFT_ROOT/src
267COPY Dockerfile $THRIFT_ROOT/
268WORKDIR $THRIFT_ROOT/src