File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ DATA_DIR=" $HOME /.cache/matrix-commander" # Directory on the host to store credentials and other data
3+ IMAGE=" matrixcommander/matrix-commander" # Docker image to use
4+ INTERACTIVE=" false" # Default setting when --interactive or --pipes is not specified
5+
6+ if [ ! -d " $DATA_DIR " ]; then
7+ echo " Creating data directory at $DATA_DIR "
8+ mkdir -p " $DATA_DIR "
9+ fi
10+ echo " Matrix is running in a container. Data is stored in $DATA_DIR "
11+
12+ if [ " $1 " = " --interactive" ]; then # With this setting keyboard input and screen output will be fine but piping to/from the container will not work.
13+ INTERACTIVE=" true"
14+ shift
15+ elif [ " $1 " = " --pipes" ]; then # With this setting keyboard input and screen output will not work but piping to/from the container will.
16+ INTERACTIVE=" false"
17+ shift
18+ fi
19+
20+ docker run -i --tty=${INTERACTIVE} --rm -v " $DATA_DIR " :/data:z ${IMAGE} " $@ "
You can’t perform that action at this time.
0 commit comments