Skip to content

Commit 00cd44f

Browse files
committed
Add docker instructions to FTL gdb debugging page
Signed-off-by: DL6ER <[email protected]>
1 parent c7e150f commit 00cd44f

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/ftldns/debugging.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,33 @@
22

33
Once you are used to it, you can skip most of the steps. Debugging *FTL*DNS is quite easy. `pihole-FTL` has been designed so that a debugger can be attached to an already running process. This will give you insights into how software (not limited to `pihole-FTL`) works.
44

5+
<!-- markdownlint-disable code-block-style -->
6+
!!! info "When running Pi-hole in a Docker container"
7+
If you are running Pi-hole in a Docker container, you will to perform all the steps described here *inside* the Docker container. You can use, e.g., `docker exec -it <container_name> /bin/bash` to get a shell inside the container.
8+
9+
You will also need to (temporarily!) add the `SYS_PTRACE` capability. This is required to allow `gdb` to attach to the `pihole-FTL` process inside the container. You can do this by starting the container with the `--cap-add=SYS_PTRACE` option. Furthermore, you need to disable the Linux kernel's secure computing mode for the container. Add `--security-opt seccomp:unconfined` in order to allow `gdb` to disable address space randomization.
10+
11+
```bash
12+
docker run -d --name pihole [your other options] --cap-add=SYS_PTRACE --security-opt seccomp:unconfined pihole/pihole
13+
```
14+
15+
or, when using `docker-compose`:
16+
17+
```yaml
18+
services:
19+
pihole:
20+
21+
# your other options ...
22+
23+
cap_add:
24+
- # your other added capabilities ...
25+
- SYS_PTRACE
26+
27+
security_opt:
28+
- seccomp:unconfined
29+
```
30+
<!-- markdownlint-enable code-block-style -->
31+
532
## Prerequirements (only required once)
633

734
1. Install `screen` and `gdb` using `sudo apt-get install screen gdb`

0 commit comments

Comments
 (0)