Created
June 18, 2015 23:56
-
-
Save branning/0cda129067f00d8e6d24 to your computer and use it in GitHub Desktop.
bootstrap a new Rails app in Docker from boot2docker
This file contains 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/sh | |
# comment by @mazzolino https://registry.hub.docker.com/_/rails/ | |
# switch to pinned version of Rails, latest was broken | |
USAGE="Usage: $0 <your app name>" | |
TAG="4.2" | |
if [ "$#" -eq 0 ]; then | |
echo "$USAGE" | |
exit 1 | |
fi | |
docker run -it -v $(pwd):/usr/src/app -w /usr/src/app rails:"$TAG" rails new "$1" |
This file contains 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/sh | |
USAGE="Usage: $0 <your app name>" | |
if [ "$#" -eq 0 ]; then | |
echo "$USAGE" | |
exit 1 | |
fi | |
cp Dockerfile "$1" | |
cd "$1" | |
docker build -t "$1" . |
This file contains 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
FROM rails:onbuild |
This file contains 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/sh | |
USAGE="Usage: $0 <your app name>" | |
if [ "$#" -eq 0 ]; then | |
echo "$USAGE" | |
exit 1 | |
fi | |
docker exec -it "$1"-container /bin/bash |
This file contains 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/sh | |
USAGE="Usage: $0 <your app name>" | |
if [ "$#" -eq 0 ]; then | |
echo "$USAGE" | |
exit 1 | |
fi | |
docker run --name "$1"-container -p 8080:3000 -v $(pwd):/usr/src/app -w /usr/src/app -d "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment