Skip to content

Instantly share code, notes, and snippets.

@tamadamas
Created December 17, 2017 18:47
Show Gist options
  • Save tamadamas/1eacc6d943fdfa7f5ed290bedfb03d64 to your computer and use it in GitHub Desktop.
Save tamadamas/1eacc6d943fdfa7f5ed290bedfb03d64 to your computer and use it in GitHub Desktop.
Create new rails project by docker one off ruby container
# Start a new, one-off ruby container running a bash shell. It should have the
# current directory mounted at '/usr/src':
docker run --rm -ti -v $(pwd):/usr/src -w /usr/src ruby:2.2.6 bash
# Now that your'e running bash inside our one-off container, install rails and generate the app.
gem install rails --no-rdoc --no-ri && rails new my-app --database=postgresql
# Exit the one-off container. The container should be removed automatically.
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment