run.sh 618 B

12345678910111213141516171819
  1. #!/bin/bash -e
  2. world=$(mktemp -d)
  3. trap 'rm -rf "$world" || :' EXIT
  4. [ -f game.conf ] || { echo "Must be run in game root folder." >&2; exit 1; }
  5. cp -v utils/test/world.mt "$world/"
  6. chmod -R a+rwX "$world" # needed because server runs as unprivileged user inside container
  7. vol=(
  8. -v "$PWD/utils/test/minetest.conf":/etc/minetest/minetest.conf
  9. --tmpfs /var/lib/minetest/.minetest
  10. -v "$PWD":/var/lib/minetest/.minetest/games/minetest_game
  11. -v "$world":/var/lib/minetest/.minetest/world
  12. )
  13. [ -z "$DOCKER_IMAGE" ] && DOCKER_IMAGE="ghcr.io/minetest/minetest:master"
  14. docker run --rm -i "${vol[@]}" "$DOCKER_IMAGE"
  15. exit 0