|
| 1 | +#!/bin/bash |
| 2 | +# |
| 3 | +# Print out debug info and fail if a sub-step fails |
| 4 | +set -exuo pipefail |
| 5 | + |
| 6 | +# Define a set of temporary docker packages used during docker building. |
| 7 | +DOCKER_BUILD_PACKAGES="software-properties-common curl" |
| 8 | + |
| 9 | +# Update APT so we can install packages. |
| 10 | +apt-get -y update |
| 11 | + |
| 12 | +# Install temporary build packages |
| 13 | +apt-get -y install $DOCKER_BUILD_PACKAGES |
| 14 | + |
| 15 | +# Install the necessary repositories: |
| 16 | +# - ubuntu-toolchain-r-test |
| 17 | +add-apt-repository ppa:ubuntu-toolchain-r/test |
| 18 | + |
| 19 | +# Install all necessary packages for curl building |
| 20 | +apt-get -y update |
| 21 | +bash /scripts/install_common.sh |
| 22 | +apt-get -y install gcc-7 g++-7 |
| 23 | + |
| 24 | +# Install gcc-7 as the standard cc and g++-7 as the standard c++ |
| 25 | +update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 10 |
| 26 | +update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 10 |
| 27 | +update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30 |
| 28 | +update-alternatives --set cc /usr/bin/gcc |
| 29 | +update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30 |
| 30 | +update-alternatives --set c++ /usr/bin/g++ |
| 31 | + |
| 32 | +# Download, compile and install other libraries. |
| 33 | +/scripts/install_nghttp2.sh |
| 34 | +/scripts/install_libidn2.sh |
| 35 | +/scripts/install_libpsl.sh |
| 36 | + |
| 37 | +# Remove the temporary build packages and any auto-installed dependencies |
| 38 | +apt-get --purge -y remove $DOCKER_BUILD_PACKAGES |
| 39 | +apt-get -y autoremove |
| 40 | + |
| 41 | +# Removing any apt cache data. |
| 42 | +rm -rf /var/lib/apt/lists/* |
0 commit comments