Skip to content

Commit 65f84d7

Browse files
author
Stefan Eissing
committed
* docker: rename debian-test to better debian-sid
* docker: added image using ubuntu-focal, not really working, since the apache is too old * docker: taking care of cbindgen install to build rustls-ffi
1 parent 22356d3 commit 65f84d7

File tree

6 files changed

+129
-16
lines changed

6 files changed

+129
-16
lines changed

Makefile.am

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ EXTRA_DIST =
2525
test: all-recursive
2626
$(MAKE) -C test/ test
2727

28-
loadtest: all-recursive
29-
$(MAKE) -C test/ loadtest
30-
28+
docker-test:
29+
docker-compose build debian-sid
30+
docker-compose run debian-sid

docker-compose.yml

+34-9
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,53 @@
11
version: '3.7'
22
services:
3-
debian-test:
3+
debian-sid:
44
# build and run tests in a debian sid container
5-
image: ${DOCKER_REGISTRY}/mod-tls-debian-test:0.0.1
6-
container_name: mod-tls-debian-test
5+
image: ${DOCKER_REGISTRY}/mod-tls-debian-sid:0.0.1
6+
container_name: mod-tls-debian-sid
77
build:
88
context: .
9-
dockerfile: docker/debian-test/Dockerfile
9+
dockerfile: docker/debian-sid/Dockerfile
1010
labels:
11-
- "description=mod_tls debian test server"
11+
- "description=mod_tls debian sid server"
1212
1313
expose:
1414
- "5010"
1515
- "5011"
1616
volumes:
17-
- mod-tls-debian-test-data:/abetterinternet/data
17+
- mod-tls-debian-sid-data:/abetterinternet/data
18+
ports:
19+
- "5010"
20+
- "5011"
21+
22+
ubuntu-focal:
23+
# build and run tests in a debian sid container
24+
image: ${DOCKER_REGISTRY}/mod-tls-ubuntu-focal:0.0.1
25+
container_name: mod-tls-ubuntu-focal
26+
build:
27+
context: .
28+
dockerfile: docker/ubuntu-focal/Dockerfile
29+
labels:
30+
- "description=mod_tls ubuntu-focal server"
31+
32+
expose:
33+
- "5010"
34+
- "5011"
35+
volumes:
36+
- mod-tls-ubuntu-focal-data:/abetterinternet/data
1837
ports:
1938
- "5010"
2039
- "5011"
2140

2241
volumes:
23-
mod-tls-debian-test-data:
24-
name: mod-tls-debian-test-data
42+
mod-tls-debian-sid-data:
43+
name: mod-tls-debian-sid-data
44+
labels:
45+
- "description=debian sid data for mod_tls"
46+
47+
mod-tls-ubuntu-focal-data:
48+
name: mod-tls-ubuntu-focal-data
2549
labels:
26-
- "description=debian test data for mod_tls"
50+
- "description=ubuntu-focal data for mod_tls"
2751
2852

53+

docker/debian-test/Dockerfile renamed to docker/debian-sid/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ RUN apt-get install -y apt-listchanges \
1010
RUN pip install pytest tqdm pycurl cryptography
1111

1212
RUN apt-get install -y apache2 apache2-dev libapache2-mod-md
13+
RUN apt-get install -y cbindgen
1314

14-
COPY docker/debian-test/bin/* /abetterinternet/bin/
15+
COPY docker/debian-sid/bin/* /abetterinternet/bin/
1516
COPY configure.ac Makefile.am NEWS README* AUTHORS ChangeLog COPYING LICENSE /abetterinternet/mod_tls/
1617
COPY src /abetterinternet/mod_tls/src
1718
COPY test/Makefile.am test/conftest.py /abetterinternet/mod_tls/test/

docker/debian-test/bin/update.sh renamed to docker/debian-sid/bin/update.sh

+2-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ rm -f $LOG_DIR/*
3838
#fi
3939

4040
cd $DATADIR
41-
if test ! -d rustls-ffi; then
42-
git clone https://github.com/rustls/rustls-ffi.git rustls-ffi
43-
fi
41+
rm -rf rustls-ffi
42+
git clone https://github.com/rustls/rustls-ffi.git rustls-ffi
4443
cd rustls-ffi
4544
git fetch origin
4645
git checkout tags/v0.8.2

docker/ubuntu-focal/Dockerfile

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM ubuntu:focal
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
RUN apt-get update; apt-get upgrade -y
5+
RUN apt-get install -y apt-listchanges \
6+
make openssl libssl-dev libcurl4 libcurl4-openssl-dev \
7+
gcc subversion git cargo python3 iputils-ping \
8+
libapr1-dev libaprutil1-dev libnghttp2-dev pip \
9+
autoconf libtool libtool-bin libpcre3-dev libjansson-dev curl rsync nghttp2-client
10+
11+
RUN pip install pytest tqdm pycurl cryptography
12+
13+
RUN apt-get install -y apache2 apache2-dev libapache2-mod-md
14+
RUN apt-get install -y cbindgen
15+
16+
COPY docker/ubuntu-focal/bin/* /abetterinternet/bin/
17+
COPY configure.ac Makefile.am NEWS README* AUTHORS ChangeLog COPYING LICENSE /abetterinternet/mod_tls/
18+
COPY src /abetterinternet/mod_tls/src
19+
COPY test/Makefile.am test/conftest.py /abetterinternet/mod_tls/test/
20+
COPY test/modules /abetterinternet/mod_tls/test/modules
21+
COPY test/pyhttpd /abetterinternet/mod_tls/test/pyhttpd
22+
COPY m4 /abetterinternet/mod_tls/m4
23+
24+
CMD ["/bin/bash", "-c", "/abetterinternet/bin/update.sh"]

docker/ubuntu-focal/bin/update.sh

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/bin/bash
2+
3+
TOP=/abetterinternet
4+
DATADIR=$TOP/data
5+
6+
fail() {
7+
echo "$@"
8+
exit 1
9+
}
10+
11+
needs_update() {
12+
local ref_file="$1"
13+
local check_dir="$2"
14+
if test ! -f "$ref_file"; then
15+
return 0
16+
fi
17+
find "$check_dir" -type f -a -newer "$ref_file" -o -type d -name .git -prune -a -false |
18+
while read fname; do
19+
return 0
20+
done
21+
return 1
22+
}
23+
24+
PREFIX=$(apxs -q exec_prefix)
25+
if test ! -d $PREFIX; then
26+
fail "apache install prefix not found: $PREFIX"
27+
fi
28+
29+
# remove some stuff that accumulates
30+
LOG_DIR=$(apxs -q logfiledir)
31+
rm -f $LOG_DIR/*
32+
33+
#cd $DATADIR
34+
#if test ! -f rustup.sh.run; then
35+
# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rustup.sh ||rm -f rustup.sh
36+
# /bin/bash rustup.sh -y ||fail
37+
# touch rustup.sh.run
38+
#fi
39+
40+
cd $DATADIR
41+
rm -rf rustls-ffi
42+
git clone https://github.com/rustls/rustls-ffi.git rustls-ffi
43+
cd rustls-ffi
44+
git fetch origin
45+
git checkout tags/v0.8.2
46+
make install DESTDIR=$PREFIX || fail
47+
48+
cd "$TOP/mod_tls" ||fail
49+
if needs_update .installed .; then
50+
rm -f .installed
51+
if test ! -f configure -o configure.ac -nt configure; then
52+
autoreconf -i ||fail
53+
fi
54+
if test ! -d Makefile -o ./configure -nt Makefile; then
55+
./configure || fail
56+
touch ./configure
57+
fi
58+
make clean||fail
59+
make ||fail
60+
find .
61+
make install ||fail
62+
touch .installed
63+
fi
64+
pytest

0 commit comments

Comments
 (0)