File indexing completed on 2024-11-24 05:05:59

0001 #!/bin/sh
0002 # Mount the project source code and enter the container
0003 
0004 OCI_IMAGE_NAME_DEFAULT="${USER}/diagram-server"
0005 OCI_IMAGE_NAME="${OCI_IMAGE_NAME:-${OCI_IMAGE_NAME_DEFAULT}}"
0006 OCI_TOOL="${OCI_TOOL:-docker}"
0007 
0008 usage()
0009 {
0010         echo "usage: $0 path/to/project"
0011 }
0012 
0013 if [ $# -lt 1 ]; then
0014         usage
0015         exit 1
0016 fi
0017 
0018 project="$1"
0019 
0020 # Run the container interactively, this will drop us to a shell inside
0021 # For debugging diagram-server, you might find mounting it useful
0022 # --mount type=bind,source="$PWD",target=/root/diagram-server \
0023 "$OCI_TOOL" run \
0024         --mount type=bind,source="${project}",target=/mnt \
0025         --publish 8080:8080 \
0026         -it "$OCI_IMAGE_NAME"