Skip to content

using docker

Emily Rockman edited this page Aug 14, 2015 · 10 revisions

boot2docker is for non-Linux OS

for initial setup

boot2docker init

installs a wrapper for the docker command line interface. Once you install this you run commands by "docker-compose" instead of just "docker". Under the hood it's generating a bunch of docker commands so you don't have to do them manually. You can add --verbose if you want to see everything it's doing.

sudo pip install docker-compose

To get social auth working echo "{ip address} local.rockman.life" >> /etc/hosts

start docker vm

boot2docker up

are things weird? try again...

boot2docker restart

wipe VM and start over

boot2docker reset

run in every shell with parenthesis, every time you want to use docker - sets environment variable needed to use Docker

$(boot2docker shellinit)

runs the command that comes after docker (without brackets) in the VM. run docker --help to see options/commands.

docker [command]

run this every time the docker/app/Dockerfile or requirements.txt change. It's safe to just run it every time you pull changes or you make changes to those files.

docker-compose build

to start up the dev server locally

docker-compose run --service-ports dev

to run tests

docker-compose up tests

force shut down all open/running containers

docker-compose rm --force

drops you into the bash shell to be able to run django commands (ie, migrate) inside of the docker container - app = python manage.py. type exit to leave

docker-compose run dev bash

get boot2docker ip address

boot2docker ip

Every so often you'll want to run this cleanup command

docker rmi $(docker images --quiet --filter "dangling=true")
Clone this wiki locally