Skip to content

Instantly share code, notes, and snippets.

@hayatbiralem
Last active February 22, 2016 08:58
Show Gist options
  • Select an option

  • Save hayatbiralem/4afd95346b99ae8462a3 to your computer and use it in GitHub Desktop.

Select an option

Save hayatbiralem/4afd95346b99ae8462a3 to your computer and use it in GitHub Desktop.
Helper shell scripts for Docker
# Usage: bash path/to/bash/scripts/docker-checkout.sh app_name
prefix="/Users/omuryanikoglu/Docker/apps/"
suffix="/app"
directory="$prefix$1$suffix"
if [ -d "$directory" ]; then
echo "App directory exists!"
docker-compose stop
cd $directory
docker-compose up -d
fi
if [ ! -d "$directory" ]; then
echo "App directory does not exist!"
fi
exit 0
# Usage: bash path/to/bash/scripts/docker-start.sh app_name
prefix="/Users/omuryanikoglu/Docker/apps/"
suffix="/app"
directory="$prefix$1$suffix"
if [ -d "$directory" ]; then
echo "App directory exists!"
cd $directory
dinghy start
docker-machine env dinghy
eval $(docker-machine env dinghy)
docker-compose up -d
docker ps -a
echo "You can use below command for to access any container"
echo "docker exec -i -t [container id] bash"
fi
if [ ! -d "$directory" ]; then
echo "App directory does not exist!"
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment