summaryrefslogtreecommitdiff
path: root/build/docker/old/ubuntu-xenial/Dockerfile
blob: 64d4804f776c5da11f7f95b89ccbfa4a25b80ecb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#
# Apache Thrift Docker build environment for Ubuntu Xenial
# Using all stock Ubuntu Xenial packaging except for:
# - d: does not come with Ubuntu so we're installing 2.087.0 for coverage
# - dart: does not come with Ubuntu so we're installing 2.0.0-1 for coverage
# - dotnet: does not come with Ubuntu
# - go: Xenial comes with 1.6, but we need 1.10 or later
# - nodejs: Xenial comes with 4.2.6 which exits LTS April 2018, so we're installing 10.x
# - ocaml: causes stack overflow error, just started March 2018 not sure why
#

FROM buildpack-deps:xenial-scm
MAINTAINER Apache Thrift <dev@thrift.apache.org>
ENV DEBIAN_FRONTEND noninteractive

### Add apt repos

RUN apt-get update && \
      apt-get dist-upgrade -y && \
      apt-get install -y --no-install-recommends \
      apt \
      apt-transport-https \
      apt-utils \
      curl \
      software-properties-common \
      wget && \

      # Dart
      curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
      curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > \
      /etc/apt/sources.list.d/dart_stable.list && \

      # dotnet (core)
      curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \
      echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > \
      /etc/apt/sources.list.d/dotnetdev.list && \

      # node.js
      curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
      echo "deb https://deb.nodesource.com/node_10.x xenial main" | tee /etc/apt/sources.list.d/nodesource.list && \

      # ruby 2.4
      apt-add-repository ppa:brightbox/ruby-ng

### install general dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
      `# General dependencies` \
      bash-completion \
      bison \
      build-essential \
      clang \
      cmake \
      debhelper \
      flex \
      gdb \
      llvm \
      ninja-build \
      pkg-config \
      valgrind \
      vim
ENV PATH /usr/lib/llvm-3.8/bin:$PATH

### languages

# TODO: "apt-get install" without "apt-get update" in the same "RUN" step can cause cache issues if modified later.
# See https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#run
RUN apt-get install -y --no-install-recommends \
      `# C++ dependencies` \
      libboost-dev \
      libboost-filesystem-dev \
      libboost-program-options-dev \
      libboost-system-dev \
      libboost-test-dev \
      libboost-thread-dev \
      libevent-dev \
      libssl-dev \
      qt5-default \
      qtbase5-dev \
      qtbase5-dev-tools

ENV D_VERSION     2.087.0
ENV DMD_DEB       dmd_2.087.0-0_amd64.deb
RUN \
      `# D dependencies` \
      wget -q http://downloads.dlang.org/releases/2.x/${D_VERSION}/${DMD_DEB} && \
      dpkg --install ${DMD_DEB} && \
      rm -f ${DMD_DEB} && \
      mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
      git clone -b 'v2.0.2+2.0.16' https://github.com/D-Programming-Deimos/libevent.git deimos-libevent-2.0 && \
      mv deimos-libevent-2.0/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
      mv deimos-libevent-2.0/C/* /usr/include/dmd/druntime/import/C/ && \
      rm -rf deimos-libevent-2.0 && \
      git clone -b 'v1.1.6+1.0.1g' https://github.com/D-Programming-Deimos/openssl.git deimos-openssl-1.0.1g && \
      mv deimos-openssl-1.0.1g/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
      mv deimos-openssl-1.0.1g/C/* /usr/include/dmd/druntime/import/C/ && \
      rm -rf deimos-openssl-1.0.1g

ENV DART_VERSION 2.7.2-1
RUN apt-get install -y --no-install-recommends \
      `# Dart dependencies` \
      dart=$DART_VERSION
ENV PATH /usr/lib/dart/bin:$PATH

RUN apt-get install -y --no-install-recommends \
      `# dotnet core dependencies` \
      dotnet-sdk-7.0 \
      dotnet-runtime-7.0 \
      aspnetcore-runtime-7.0 \
      dotnet-apphost-pack-7.0

# Erlang dependencies
ARG ERLANG_OTP_VERSION=18.3.4.11
ARG ERLANG_REBAR_VERSION=3.13.2
RUN apt-get update && apt-get install -y --no-install-recommends automake libncurses5-dev && \
      curl https://raw.githubusercontent.com/kerl/kerl/master/kerl -o /usr/local/bin/kerl && chmod +x /usr/local/bin/kerl && \
      kerl build $ERLANG_OTP_VERSION && kerl install $ERLANG_OTP_VERSION /usr/local/lib/otp/ && . /usr/local/lib/otp/activate && \
      curl https://s3.amazonaws.com/rebar3/rebar3 -o /usr/local/bin/rebar3 && chmod +x /usr/local/bin/rebar3 && \
      curl -ssLo /usr/local/bin/rebar3 https://github.com/erlang/rebar3/releases/download/${ERLANG_REBAR_VERSION}/rebar3 && chmod +x /usr/local/bin/rebar3 && \
      rebar3 --version
ENV PATH /usr/local/lib/otp/bin:$PATH

RUN apt-get install -y --no-install-recommends \
      `# GlibC dependencies` \
      libglib2.0-dev

# golang
ENV GOLANG_VERSION 1.18.5
ENV GOLANG_DOWNLOAD_URL https://go.dev/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
ENV GOLANG_DOWNLOAD_SHA256 9e5de37f9c49942c601b191ac5fba404b868bfc21d446d6960acc12283d6e5f2
RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \
      echo "$GOLANG_DOWNLOAD_SHA256  golang.tar.gz" | sha256sum -c - && \
      tar -C /usr/local -xzf golang.tar.gz && \
      ln -s /usr/local/go/bin/go /usr/local/bin && \
      rm golang.tar.gz

RUN apt-get install -y --no-install-recommends \
      `# Haxe dependencies` \
      haxe \
      neko \
      neko-dev \
      libneko0 && \
      haxelib setup --always /usr/share/haxe/lib && \
      haxelib install --always hxcpp 3.4.64 2>&1 > /dev/null
# note: hxcpp 3.4.185 (latest) no longer ships static libraries, and caused a build failure

ENV GRADLE_VERSION="8.0.2"
RUN apt-get install -y --no-install-recommends \
      `# Java dependencies` \
      ant \
      ant-optional \
      openjdk-8-jdk \
      maven \
      unzip && \
      `# Gradle` \
      wget https://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip -q -O /tmp/gradle-$GRADLE_VERSION-bin.zip && \
      (echo "ff7bf6a86f09b9b2c40bb8f48b25fc19cf2b2664fd1d220cd7ab833ec758d0d7  /tmp/gradle-$GRADLE_VERSION-bin.zip" | sha256sum -c -) && \
      unzip -d /tmp /tmp/gradle-$GRADLE_VERSION-bin.zip && \
      mv /tmp/gradle-$GRADLE_VERSION /usr/local/gradle && \
      ln -s /usr/local/gradle/bin/gradle /usr/local/bin

# disabled: same as ubuntu-bionic jobs
# RUN apt-get install -y --no-install-recommends \
# `# Lua dependencies` \
#       lua5.2 \
#       lua5.2-dev
# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
# lua5.3 does not install alternatives so stick with 5.2 here

RUN apt-get install -y --no-install-recommends \
      `# Node.js dependencies` \
      nodejs

# Test dependencies for running puppeteer
RUN apt-get install -y --no-install-recommends \
      `# JS dependencies` \
      libxss1 \
      libxtst6 \
      libatk-bridge2.0-0 \
      libgtk-3-0

# THRIFT-4517: causes stack overflows; version too old; skip ocaml in xenial
# RUN apt-get install -y --no-install-recommends \
# `# OCaml dependencies` \
#       ocaml \
#       opam && \
#     opam init --yes && \
#     opam install --yes oasis

RUN apt-get install -y --no-install-recommends \
      `# Perl dependencies` \
      libbit-vector-perl \
      libclass-accessor-class-perl \
      libcrypt-ssleay-perl \
      libio-socket-ssl-perl \
      libnet-ssleay-perl \
      libtest-exception-perl

RUN apt-get install -y --no-install-recommends \
      `# Php dependencies` \
      php7.0 \
      php7.0-cli \
      php7.0-dev \
      php-json \
      php-pear \
      re2c \
      composer

RUN apt-get install -y --no-install-recommends \
      `# Python dependencies` \
      python-all \
      python-all-dbg \
      python-all-dev \
      python-backports.ssl-match-hostname \
      python-ipaddress \
      python-pip \
      python-setuptools \
      python-six \
      python-tornado \
      python-twisted \
      python-wheel \
      python-zope.interface \
      python3-all \
      python3-all-dbg \
      python3-all-dev \
      python3-setuptools \
      python3-six \
      python3-tornado \
      python3-twisted \
      python3-wheel \
      python3-zope.interface && \
      pip install --upgrade backports.ssl_match_hostname

RUN apt-get install -y --no-install-recommends \
      `# Ruby dependencies` \
      ruby2.4 \
      ruby2.4-dev \
      ruby-bundler

# Rust dependencies
RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.61.0 -y

# Locale(s) for cpp unit tests
RUN apt-get install -y --no-install-recommends \
      `# Locale dependencies` \
      locales && \
      locale-gen en_US.UTF-8 && \
      locale-gen de_DE.UTF-8 && \
      update-locale

# NOTE: this does not reduce the image size but adds an additional layer.
# # Clean up
# RUN rm -rf /var/cache/apt/* && \
#     rm -rf /var/lib/apt/lists/* && \
#     rm -rf /tmp/* && \
#     rm -rf /var/tmp/*

ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
ENV THRIFT_ROOT /thrift
RUN mkdir -p $THRIFT_ROOT/src
COPY Dockerfile $THRIFT_ROOT/
WORKDIR $THRIFT_ROOT/src