Skip to content

Instantly share code, notes, and snippets.

@resourcemode
Created January 28, 2019 02:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save resourcemode/e4258881326cc6b99871b1951e9ddcf7 to your computer and use it in GitHub Desktop.
Save resourcemode/e4258881326cc6b99871b1951e9ddcf7 to your computer and use it in GitHub Desktop.
echo "Open bash for docker containers"
echo "1.) projectA"
echo "2.) projectB"
echo -n "Enter the docker number and press [ENTER]: "
read choice
if [ "$choice" == "1" ]; then
choice='projectA'
elif [ "$choice" == "2" ]; then
choice='projectB'
else
echo "There is no such container choice"
fi
echo "Entering bash of $choice"
cd projects
docker exec -it $choice bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment