Last active
          August 29, 2015 14:07 
        
      - 
      
- 
        Save vyshane/a007597b4a0d984b8010 to your computer and use it in GitHub Desktop. 
    Example Docker build and run script
  
        
  
    
      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
    
  
  
    
  | #!/usr/bin/env bash | |
| org=kojai | |
| app=web-services | |
| branch=`git rev-parse --abbrev-ref HEAD` | |
| if [ "$branch" == master ]; then | |
| branch=latest | |
| fi | |
| docker build -q -t $org/$app:$branch . | |
| docker stop $org-$app | |
| docker rm -f $org-$app | |
| docker run -d \ | |
| -p 80:80 \ | |
| --name $org-$app \ | |
| --link kojai-mongodb:db \ | |
| $org/$app:$branch | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment