if [ -n "$1" ]; then
	TAG=$1
else
	read REPOSITORY TAG ID CREATED SIZE < <(docker images | grep bvbnatsu)
fi

echo "Starting bvbnatsu/tsukuba2022:$TAG"

docker run \
    --rm \
    -p 6080:80 \
    -p 2222:22 \
    -p 10940:10940 \
    -p 2368:2368/udp \
    -p 8308:8308/udp \
    -e HOME=/home/ubuntu \
    -e SHELL=/bin/bash \
    -v /home/kbkn/tsukuba2022/waypoint_navigation:/home/ubuntu/catkin_ws/src/waypoint_navigation \
    --shm-size=512m \
    --entrypoint '/startup.sh'\
    bvbnatsu/tsukuba2022:$TAG
