-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
32 lines (31 loc) · 1.22 KB
/
Copy pathdocker-compose.yml
File metadata and controls
32 lines (31 loc) · 1.22 KB
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
# Controlled Debian environment for ft_ping.
#
# The image builds GNU inetutils 2.0 from source (the subject's reference),
# available inside the container as `ping` / `inetutils-2.0-ping` for easy
# side-by-side comparison. NET_RAW is granted so raw ICMP sockets work.
#
# docker compose up -d # start the container (stays running)
# docker compose exec ftping bash # get a shell inside it
# docker compose exec ftping make re # build ft_ping
# docker compose exec ftping ./ft_ping -c3 8.8.8.8
# docker compose exec ftping ping -c3 8.8.8.8 # inetutils-2.0 reference
# docker compose exec ftping bash tests/run_tests.sh
# docker compose down # stop / remove it
#
# One-off shell without keeping a container around:
# docker compose run --rm ftping bash
services:
ftping:
build:
context: .
dockerfile: docker/Dockerfile
image: ft_ping_debian
container_name: ft_ping
cap_add:
- NET_RAW # required for SOCK_RAW / IPPROTO_ICMP
volumes:
- .:/ft_ping # live-mount the source; edits on the host are seen
working_dir: /ft_ping
tty: true
stdin_open: true
command: sleep infinity # keep the container alive for `exec`