Skip to content

Commit

Permalink
add ubuntu focal build
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiayu Liu committed Apr 18, 2022
1 parent 90ea2e8 commit 12bd04e
Show file tree
Hide file tree
Showing 2 changed files with 285 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#
# Docker Integration
# see: build/docker/README.md
#
#

sudo: required
dist: trusty
Expand Down Expand Up @@ -65,6 +65,11 @@ jobs:
- JOB="Docker Build ubuntu-bionic 18.04 LTS"
- DISTRO=ubuntu-bionic
- TRAVIS_BUILD_STAGE=docker
- script: true
env:
- JOB="Docker Build ubuntu-focal 20.04 LTS"
- DISTRO=ubuntu-focal
- TRAVIS_BUILD_STAGE=docker

# ========================= stage: thrift =======================
# ------------------------- phase: cross ------------------------
Expand Down Expand Up @@ -119,6 +124,12 @@ jobs:
- DISTRO=ubuntu-xenial
- SCRIPT="autotools.sh"

- script: build/docker/run.sh
env:
- JOB="Autotools (Ubuntu Focal)"
- DISTRO=ubuntu-focal
- SCRIPT="autotools.sh"

# ------------------------- phase: cmake ------------------------
- script: build/docker/run.sh
env:
Expand Down
273 changes: 273 additions & 0 deletions build/docker/ubuntu-focal/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,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 Focal
# with some updated packages.
#

FROM buildpack-deps:focal-scm
LABEL 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 \
dirmngr \
software-properties-common \
wget

# Dart
RUN 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 (netcore)
RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \
wget -q -O /etc/apt/sources.list.d/microsoft-prod.list https://packages.microsoft.com/config/ubuntu/18.04/prod.list && \
chown root:root /etc/apt/trusted.gpg.d/microsoft.gpg && \
chown root:root /etc/apt/sources.list.d/microsoft-prod.list

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

### 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 \
libasound2 \
libatk-bridge2.0-0 \
libgtk-3-0 \
llvm \
ninja-build \
pkg-config \
unzip \
valgrind \
vim
ENV PATH /usr/lib/llvm-6.0/bin:$PATH

# lib/as3 (ActionScript)
RUN mkdir -p /usr/local/adobe/flex/4.6 && \
cd /usr/local/adobe/flex/4.6 && \
wget -q "http://download.macromedia.com/pub/flex/sdk/flex_sdk_4.6.zip" && \
unzip flex_sdk_4.6.zip
ENV FLEX_HOME /usr/local/adobe/flex/4.6

RUN apt-get install -y --no-install-recommends \
`# C++ dependencies` \
libboost-all-dev \
libevent-dev \
libssl-dev \
qt5-default \
qtbase5-dev \
qtbase5-dev-tools

ENV SBCL_VERSION 1.5.3
RUN \
`# Common Lisp (sbcl) dependencies` \
curl --version && \
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# && \
tar xjf sbcl-${SBCL_VERSION}-x86-64-linux-binary.tar.bz2 && \
cd sbcl-${SBCL_VERSION}-x86-64-linux && \
./install.sh && \
sbcl --version && \
cd .. && \
rm -rf sbcl*

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 'v2.0.0+1.1.0h' https://github.com/D-Programming-Deimos/openssl.git deimos-openssl-1.1.0h && \
mv deimos-openssl-1.1.0h/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
mv deimos-openssl-1.1.0h/C/* /usr/include/dmd/druntime/import/C/ && \
rm -rf deimos-openssl-1.1.0h

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-6.0 \
dotnet-runtime-6.0 \
aspnetcore-runtime-6.0 \
dotnet-apphost-pack-6.0

# Erlang dependencies
ARG ERLANG_OTP_VERSION=23.3.4.11
ARG ERLANG_REBAR_VERSION=3.18.0
RUN apt-get update && apt-get install -y --no-install-recommends libncurses5-dev && \
curl -ssLo /usr/local/bin/kerl https://raw.githubusercontent.com/kerl/kerl/master/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 -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.17.6
ENV GOLANG_DOWNLOAD_URL https://go.dev/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
ENV GOLANG_DOWNLOAD_SHA256 231654bbf2dab3d86c1619ce799e77b03d96f9b50770297c8f4dff8836fc8ca2
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 && \
haxelib setup --always /usr/share/haxe/lib && \
haxelib install --always hxcpp 2>&1 > /dev/null

RUN apt-get install -y --no-install-recommends \
`# Java dependencies` \
ant \
ant-optional \
maven \
openjdk-17-jdk-headless

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!
# need to update our luasocket code, lua doesn't have luaL_openlib any more

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

# does not work on disco/focal?
# 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` \
php \
php-cli \
php-dev \
php-json \
php-pear \
re2c \
composer

RUN apt-get install -y --no-install-recommends \
`# Python3 dependencies` \
python3-all \
python3-all-dbg \
python3-all-dev \
python3-pip \
python3-setuptools \
python3-six \
python3-tornado \
python3-twisted \
python3-wheel \
python3-zope.interface

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

# Rust dependencies
RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.40.0 -y
ENV PATH /root/.cargo/bin:$PATH

# Swift on Linux for cross tests
# does not work on disco/focal
# RUN cd / && \
# 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 && \
# tar xf swift-4.2.1-RELEASE-ubuntu18.04.tar.gz --strip-components=1 && \
# rm swift-4.2.1-RELEASE-ubuntu18.04.tar.gz && \
# swift --version

# 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

# cppcheck-1.82 has a nasty cpp parser bug, so we're using something newer
# don't need this on disco/focal, nobody uses it
# RUN apt-get install -y --no-install-recommends \
# `# Static Code Analysis dependencies` \
# cppcheck \
# sloccount && \
# pip install flake8 && \
# wget -q "https://launchpad.net/ubuntu/+source/cppcheck/1.83-2/+build/14874703/+files/cppcheck_1.83-2_amd64.deb" && \
# dpkg -i cppcheck_1.83-2_amd64.deb && \
# rm cppcheck_1.83-2_amd64.deb

# Clean up
RUN rm -rf /var/cache/apt/* && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/* && \
rm -rf /var/tmp/*

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

0 comments on commit 12bd04e

Please sign in to comment.