run 714 B

1234567891011121314151617181920212223
  1. #!/usr/bin/env bash
  2. set -ex
  3. # Usage:
  4. # contrib/docker/run [<name>]
  5. # docker exec -it cjdns[-<name>] cjdnslog
  6. # docker exec -it cjdns[-<name>] peerStats
  7. # docker exec -it cjdns[-<name>] sessionState
  8. # docker exec -it cjdns[-<name>] dumptable
  9. # docker exec -it cjdns[-<name>] <any-command-from-tools/>
  10. # cat contrib/docker/cjdns[-<name>]/cjdroute.conf
  11. # Location of cjdroute.conf within the container
  12. CONF_DIR="/etc/cjdns"
  13. [ "$1" = "" ] && name="cjdns" || name="cjdns-$1"
  14. docker build -f contrib/docker/Dockerfile -t $name .
  15. exec docker run -it --rm --name=$name \
  16. --cap-add=NET_ADMIN --device=/dev/net/tun \
  17. --volume="$(pwd)/contrib/docker/$name:$CONF_DIR" $name