Last active
September 20, 2023 02:26
-
-
Save ktolutom/66f97e263c3150774a0c883856dc023b to your computer and use it in GitHub Desktop.
start_docker_shell #docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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