If you are completely new to Docker, please see the Getting Started with Docker Guide on Docker's official website. Your first exposure to using containers can be confusing, so please don't hesitate to ask your team's Technical Lead for help.
Select the installation guide below for your laptop's operating system:
For Mac OSX and Windows users, Docker Compose is already included with the Docker toolbox.
For linux users, you will have to install the docker compose binary from the Docker Compoose release repository. Please follow the instructions below to properly install docker compose:
- Run this command in your terminal to install the Docker Compose binary
sudo curl -L https://github.com/docker/compose/releases/download/1.17.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
- Apply executable permissions to the binary
sudo chmod +x /usr/local/bin/docker-compose
3.) Run the following command to confirm that Docker Compose was properly installed:
docker-compose --version
You should expect the results to look similar to:
docker-compose version 1.17.0, build 1719ceb
Build the docker images by running the following command:
docker-compose build
This will build your ruby
, postgres
, and backyardscoffee_web
images
- You will need an empty
Gemfile.lock
in order to build yourDockerfile
. You can delete and create a new blank dockerfile by running the following commands in the rails app root directory:
rm -rf Gemfile.lock
touch Gemfile.lock
The following command will run your containers:
docker-compose up
If this is your first time running these containers, you will need to run the following commands to setup the database:
docker-compose run web rake db:create
docker-compose run web rake db:migrate
This will create and migrate all databases in config/database.yml
.
Run docker-compose up
again to run your rails app.
Please contact your Techinical Lead(s) if you have any problems getting your docker containers set up