Skip to content

Instantly share code, notes, and snippets.

@fmunirdev
Last active December 26, 2019 18:48
Show Gist options
  • Save fmunirdev/bb1c9a69f5cf9c0d74a8ff28f18a71de to your computer and use it in GitHub Desktop.
Save fmunirdev/bb1c9a69f5cf9c0d74a8ff28f18a71de to your computer and use it in GitHub Desktop.
Shell script to build and run repastnode's docker container.
#!/bin/sh
REPAST_SCRIPT='repastmulti.sh'
# Verify REPAST_SCRIPT script
[ ! -f $REPAST_SCRIPT ] &&\
echo "repastmulti script '$REPAST_SCRIPT' not found" &&\
exit 1
sed -i '7cINSTALLATION=/EMS/repast' $REPAST_SCRIPT
cat >Dockerfile <<EOF
FROM openjdk:8u232-jdk-stretch
WORKDIR /EMS
COPY . .
CMD ["./$REPAST_SCRIPT", "S"]
EOF
echo "Dockerfile created"
cat >.dockerignore <<EOF
ambulanceservicemodel/
fManager/
hospitalmodel/
output/
repast/RepastTest2/fManager
repast/RepastTest2/ambulanceservicemodel
repast/RepastTest2/hospitalmodel
EOF
echo ".dockerignore created"
docker build . -t repastnode
sed -i '7cINSTALLATION='$PWD'/repast' $REPAST_SCRIPT
docker run repastnode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment