37 lines
1.0 KiB
Bash
Executable File
37 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
up () {
|
|
docker run \
|
|
--name netdata \
|
|
--detach \
|
|
--restart unless-stopped \
|
|
--cap-add SYS_PTRACE \
|
|
--cap-add SYS_ADMIN \
|
|
--pid host \
|
|
--security-opt apparmor=unconfined \
|
|
--env-file $HOME/scripts-private/lech/netdata.env \
|
|
--volume /mammoth/netdata/netdata/etc/netdata:/etc/netdata:rw \
|
|
--volume /mammoth/netdata/netdata/var/lib/netdata:/var/lib/netdata:rw \
|
|
--volume /mammoth/netdata/netdata/var/cache/netdata:/var/cache/netdata:rw \
|
|
--volume /:/host/root:ro,rslave \
|
|
--volume /etc/group:/host/etc/group:ro \
|
|
--volume /etc/localtime:/etc/localtime:ro \
|
|
--volume /etc/os-release:/host/etc/os-release:ro \
|
|
--volume /etc/passwd:/host/etc/passwd:ro \
|
|
--volume /proc:/host/proc:ro \
|
|
--volume /sys:/host/sys:ro \
|
|
--volume /var/log:/host/var/log:ro \
|
|
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
|
|
--network host \
|
|
netdata/netdata:stable
|
|
}
|
|
|
|
down () {
|
|
docker stop netdata || true
|
|
docker rm netdata || true
|
|
}
|
|
|
|
$@
|