-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.test.yml
83 lines (76 loc) · 1.9 KB
/
docker-compose.test.yml
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
version: "2.4"
services:
sut:
image: alpine:3.18
environment:
DOCKER_HOST: unix:///var/run/docker.sock
COMPOSE_PROJECT_NAME: ${COMPOSE_PROJECT_NAME:-container-jail}
COMPOSE_FILE: docker-compose.yml:docker-compose.test.yml
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./:/usr/src/app:ro
working_dir: /usr/src/app
depends_on:
- alpine-test
- debian-test
- ubuntu-test
command:
- /bin/sh
- -c
- |
set -ex
apk add --no-cache docker-cli-compose
counter=0
while ! docker compose logs alpine-test | grep -q "healthcheck.sh exited with status 0"; do
sleep 3
counter=$$((counter+1))
if [ $$counter -gt 30 ]; then
exit 1
fi
done
counter=0
while ! docker compose logs debian-test | grep -q "healthcheck.sh exited with status 0"; do
sleep 3
counter=$$((counter+1))
if [ $$counter -gt 30 ]; then
exit 1
fi
done
counter=0
while ! docker compose logs ubuntu-test | grep -q "healthcheck.sh exited with status 0"; do
sleep 3
counter=$$((counter+1))
if [ $$counter -gt 30 ]; then
exit 1
fi
done
alpine-test:
extends:
file: docker-compose.yml
service: jailer
build:
args:
TEST_IMAGE: alpine:3.18
cache_from:
- sut:latest
hostname: alpine-test
debian-test:
extends:
file: docker-compose.yml
service: jailer
build:
args:
TEST_IMAGE: debian:bookworm-slim
cache_from:
- sut:latest
hostname: debian-test
ubuntu-test:
extends:
file: docker-compose.yml
service: jailer
build:
args:
TEST_IMAGE: ubuntu:jammy
cache_from:
- sut:latest
hostname: ubuntu-test