Skip to content

Commit d53ebac

Browse files
committed
trusty: Add image based on ubuntu trusty
Using ubuntu trusty, come up with a reasonably minimal image that can compile curl with gcc-7. Closes #1
1 parent ca5c2ca commit d53ebac

File tree

8 files changed

+135
-0
lines changed

8 files changed

+135
-0
lines changed

base-ubuntu-trusty/Dockerfile.gcc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Base from Ubuntu trusty
2+
FROM ubuntu:trusty
3+
4+
# The docker build process is noninteractive
5+
ARG DEBIAN_FRONTEND=noninteractive
6+
7+
# Run the install process using the provided script
8+
COPY scripts/ /scripts/
9+
RUN /scripts/dockerfile_gcc.sh

base-ubuntu-trusty/build.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
set -euxo pipefail
4+
5+
# Build gcc image
6+
docker build -f Dockerfile.gcc \
7+
-t curlimages/base-ubuntu-trusty:gcc \
8+
.

base-ubuntu-trusty/push.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
set -euxo pipefail
4+
5+
# Push docker image. This assumes that the curlimages user is logged in.
6+
docker push curlimages/base-ubuntu-trusty:gcc
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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/*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
# Install common dependencies
4+
apt-get -y install make \
5+
pkg-config \
6+
autoconf \
7+
libtool \
8+
valgrind \
9+
libev-dev \
10+
libc-ares-dev \
11+
libstdc++-7-dev \
12+
stunnel4 \
13+
libssh2-1-dev \
14+
libssh-dev \
15+
krb5-user \
16+
autopoint \
17+
libunistring-dev \
18+
python
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
set -exuo pipefail
4+
5+
# Download, compile and install libidn2.
6+
pushd /tmp
7+
curl -L https://ftp.gnu.org/gnu/libidn/libidn2-2.0.4.tar.gz | tar -xzvf -
8+
pushd libidn2-2.0.4
9+
./configure --prefix=/usr
10+
make
11+
make install
12+
popd
13+
14+
# Clean up afterwards.
15+
rm -rf libidn2-2.0.4
16+
popd
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
set -exuo pipefail
4+
5+
# Download, compile and install libpsl.
6+
pushd /tmp
7+
curl -L https://github.com/rockdaboot/libpsl/releases/download/libpsl-0.20.1/libpsl-0.20.1.tar.gz | tar -xzvf -
8+
pushd libpsl-0.20.1
9+
autoreconf -i
10+
./configure --prefix=/usr
11+
make
12+
make install
13+
popd
14+
15+
# Clean up afterwards.
16+
rm -rf libpsl-0.20.1
17+
popd
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
set -euxo pipefail
4+
5+
apt-get install -y libcunit1-dev \
6+
libjemalloc-dev
7+
8+
# Download, compile and install nghttp2.
9+
pushd /tmp
10+
curl -L https://github.com/nghttp2/nghttp2/releases/download/v1.24.0/nghttp2-1.24.0.tar.gz | tar xzvf -
11+
pushd nghttp2-1.24.0
12+
./configure --prefix=/usr --disable-threads --enable-app
13+
make
14+
make install
15+
popd
16+
17+
# Clean up afterwards.
18+
rm -rf nghttp2-1.24.0
19+
popd

0 commit comments

Comments
 (0)