You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
636 B
31 lines
636 B
OS_PERMS=sudo |
|
IMAGE_NAME=nethack-server |
|
NETHACK_DIR=$(shell pwd)/savedata |
|
|
|
all: run |
|
|
|
run: savedata |
|
$(OS_PERMS) docker run \ |
|
-d \ |
|
-p 23:23 \ |
|
-v $(NETHACK_DIR)/var:/opt/nethack/nethack.alt.org/nh343/var:rw \ |
|
-v $(NETHACK_DIR)/dgldir:/opt/nethack/nethack.alt.org/dgldir:rw \ |
|
--name=nethack \ |
|
--restart always \ |
|
$(IMAGE_NAME) |
|
|
|
|
|
build: |
|
mkdir -p stage.tmp/ |
|
cp deps/chowner.sh stage.tmp/ |
|
cp deps/dgamelaunch.conf stage.tmp/ |
|
cp deps/Dockerfile stage.tmp/ |
|
cp deps/run.sh stage.tmp/ |
|
cd stage.tmp/ && \ |
|
$(OS_PERMS) docker build -t $(IMAGE_NAME) . |
|
|
|
savedata: |
|
tar -xzf deps/initial_savedata.tar.gz |
|
|
|
clean: |
|
rm -rf stage.tmp/
|
|
|