Skip to content

Instantly share code, notes, and snippets.

@ktolutom
Last active September 20, 2023 02:26
Show Gist options
  • Save ktolutom/66f97e263c3150774a0c883856dc023b to your computer and use it in GitHub Desktop.
Save ktolutom/66f97e263c3150774a0c883856dc023b to your computer and use it in GitHub Desktop.
start_docker_shell #docker
#!/bin/bash
if [ "$#" == 0 ]; then
docker run --workdir=/volume -p 8889:8889 -it --rm --net=host -e DISPLAY=$DISPLAY --ipc=host -v $HOME/.Xauthority:$HOME/.Xauthority -v /tmp/.X11-unix:/tmp/.X11-unix -v $PWD:/volume myimage:1.0 /bin/bash
elif [ "$#" == 1 ]; then
docker run --workdir=/volume -p 8889:8889 -it --rm --net=host -e DISPLAY=$DISPLAY --ipc=host -v $HOME/.Xauthority:$HOME/.Xauthority -v /tmp/.X11-unix:/tmp/.X11-unix -v $PWD:/volume myimage:1.0 /bin/bash
else
echo 'Usage: bash start_docker_shell.sh'
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment