Last active
February 22, 2016 08:58
-
-
Save hayatbiralem/4afd95346b99ae8462a3 to your computer and use it in GitHub Desktop.
Helper shell scripts for 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
| # 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 |
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
| # 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