run.sh 549 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#!/bin/bash

# start the container in the background
CONTAINER=$(docker run -i \
	-d \
	-v $(pwd)/models:/home/elphel/x3domlet/models \
	-v $(pwd)/kml:/home/elphel/x3domlet/kml \
	-p 8080:8080 \
	-p 35729:35729 \
	x3domlet \
	gulp connect) || exit

echo $CONTAINER

# temporize
sleep 5

# open in browser
xdg-open http://127.0.0.1:8080/index.html

# display container startup log
docker logs --since 0 $CONTAINER &

# attach to container
docker attach $CONTAINER

# on exit remove the container and its associated volumes
docker rm -f -v $CONTAINER