docker-test.sh 992 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. SCRIPT_DIR="$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P)"
  3. export DEBIAN_FRONTEND=noninteractive
  4. if [ -z "$(command -v nc 2>/dev/null)" ] && [ -z "$(command -v netcat 2>/dev/null)" ]; then
  5. sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install -y netcat
  6. fi
  7. docker run -d --name=netdata \
  8. -p 19999:19999 \
  9. -v netdataconfig:/etc/netdata \
  10. -v netdatalib:/var/lib/netdata \
  11. -v netdatacache:/var/cache/netdata \
  12. -v /etc/passwd:/host/etc/passwd:ro \
  13. -v /etc/group:/host/etc/group:ro \
  14. -v /proc:/host/proc:ro \
  15. -v /sys:/host/sys:ro \
  16. -v /etc/os-release:/host/etc/os-release:ro \
  17. --cap-add SYS_PTRACE \
  18. --security-opt apparmor=unconfined \
  19. netdata/netdata:test
  20. if ! "${SCRIPT_DIR}/../../packaging/runtime-check.sh"; then
  21. docker ps -a
  22. echo "::group::Netdata container logs"
  23. docker logs netdata 2>&1
  24. echo "::endgroup::"
  25. fi