images can be also persistent
This commit is contained in:
@@ -6,6 +6,7 @@ function helpexit() {
|
|||||||
echo " --vnc Start VNC viewer"
|
echo " --vnc Start VNC viewer"
|
||||||
echo " --geometry WxY VNC Default screen size"
|
echo " --geometry WxY VNC Default screen size"
|
||||||
echo " --new-passwd Generate new random VNC password file"
|
echo " --new-passwd Generate new random VNC password file"
|
||||||
|
echo " --persistent Do not remove container at exit"
|
||||||
echo " --help This help"
|
echo " --help This help"
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
@@ -16,13 +17,14 @@ function rsagen() {
|
|||||||
rm -f .id_rsa .id_rsa.pub
|
rm -f .id_rsa .id_rsa.pub
|
||||||
ssh-keygen -t rsa -b 1024 -N "" -f .id_rsa
|
ssh-keygen -t rsa -b 1024 -N "" -f .id_rsa
|
||||||
}
|
}
|
||||||
|
RMIMAGE="--rm"
|
||||||
for (( i=1; i<=$#; i++ )); do
|
for (( i=1; i<=$#; i++ )); do
|
||||||
j=$(( $i + 1 ))
|
j=$(( $i + 1 ))
|
||||||
[[ "${!i}" = "--help" ]] && helpexit
|
[[ "${!i}" = "--help" ]] && helpexit
|
||||||
[[ "${!i}" = "-h" ]] && helpexit
|
[[ "${!i}" = "-h" ]] && helpexit
|
||||||
[[ "${!i}" = "--vnc" ]] && { VNC=1; continue; }
|
[[ "${!i}" = "--vnc" ]] && { VNC=1; continue; }
|
||||||
[[ "${!i}" = "--new-passwd" ]] && { pwgen; continue; }
|
[[ "${!i}" = "--new-passwd" ]] && { pwgen; continue; }
|
||||||
|
[[ "${!i}" = "--persistent" ]] && { RMIMAGE=""; continue; }
|
||||||
[[ "${!i}" = "--geometry" ]] && {
|
[[ "${!i}" = "--geometry" ]] && {
|
||||||
VNCSIZE="-geometry ${!j}";
|
VNCSIZE="-geometry ${!j}";
|
||||||
[[ "$VNCSIZE" = *x* ]] || {
|
[[ "$VNCSIZE" = *x* ]] || {
|
||||||
@@ -57,7 +59,7 @@ echo $image
|
|||||||
docker build -t $image .
|
docker build -t $image .
|
||||||
nname=$image$$
|
nname=$image$$
|
||||||
|
|
||||||
docker run --rm -v /mnt:/mnt -v /media:/media -v $HOME/:/host_home \
|
docker run $RMIMAGE -v /mnt:/mnt -v /media:/media -v $HOME/:/host_home \
|
||||||
--privileged \
|
--privileged \
|
||||||
-h $nname --name $nname $image \
|
-h $nname --name $nname $image \
|
||||||
bash /bootstuff.sh $USER &
|
bash /bootstuff.sh $USER &
|
||||||
|
|||||||
Reference in New Issue
Block a user