Manual fixes to docs

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
Aanand Prasad 2015-01-20 17:44:48 +00:00
parent e3c4a662d9
commit 724be54f09
8 changed files with 30 additions and 36 deletions

View File

@ -22,7 +22,7 @@ Run `docker-compose [COMMAND] --help` for full usage.
### -f, --file FILE ### -f, --file FILE
Specify an alternate docker-compose file (default: docker-compose.yml) Specify an alternate compose file (default: docker-compose.yml)
### -p, --project-name NAME ### -p, --project-name NAME
@ -34,7 +34,7 @@ Run `docker-compose [COMMAND] --help` for full usage.
Build or rebuild services. Build or rebuild services.
Services are built once and then tagged as `project_service`, e.g. `docker-composetest_db`. If you change a service's `Dockerfile` or the contents of its build directory, you can run `docker-compose build` to rebuild it. Services are built once and then tagged as `project_service`, e.g. `composetest_db`. If you change a service's `Dockerfile` or the contents of its build directory, you can run `docker-compose build` to rebuild it.
### help ### help
@ -77,7 +77,7 @@ For example:
By default, linked services will be started, unless they are already running. By default, linked services will be started, unless they are already running.
One-off commands are started in new containers with the same condocker-compose as a normal container for that service, so volumes, links, etc will all be created as expected. The only thing different to a normal container is the command will be overridden with the one specified and by default no ports will be created in case they collide. One-off commands are started in new containers with the same configuration as a normal container for that service, so volumes, links, etc will all be created as expected. The only thing different to a normal container is the command will be overridden with the one specified and by default no ports will be created in case they collide.
Links are also created between one-off commands and the other containers for that service so you can do stuff like this: Links are also created between one-off commands and the other containers for that service so you can do stuff like this:
@ -122,9 +122,9 @@ By default if there are existing containers for a service, `docker-compose up` w
## Environment Variables ## Environment Variables
Several environment variables can be used to condocker-composeure Compose's behaviour. Several environment variables can be used to configure Compose's behaviour.
Variables starting with `DOCKER_` are the same as those used to condocker-composeure the Docker command-line client. If you're using boot2docker, `$(boot2docker shellinit)` will set them to their correct values. Variables starting with `DOCKER_` are the same as those used to configure the Docker command-line client. If you're using boot2docker, `$(boot2docker shellinit)` will set them to their correct values.
### FIG\_PROJECT\_NAME ### FIG\_PROJECT\_NAME
@ -144,4 +144,4 @@ When set to anything other than an empty string, enables TLS communication with
### DOCKER\_CERT\_PATH ### DOCKER\_CERT\_PATH
Condocker-composeure the path to the `ca.pem`, `cert.pem` and `key.pem` files used for TLS verification. Defaults to `~/.docker`. Configure the path to the `ca.pem`, `cert.pem` and `key.pem` files used for TLS verification. Defaults to `~/.docker`.

View File

@ -30,4 +30,4 @@ Depending on what you typed on the command line so far, it will complete
- service names that make sense in a given context (e.g. services with running or stopped instances or services based on images vs. services based on Dockerfiles). For `docker-compose scale`, completed service names will automatically have "=" appended. - service names that make sense in a given context (e.g. services with running or stopped instances or services based on images vs. services based on Dockerfiles). For `docker-compose scale`, completed service names will automatically have "=" appended.
- arguments for selected options, e.g. `docker-compose kill -s` will complete some signals like SIGHUP and SIGUSR1. - arguments for selected options, e.g. `docker-compose kill -s` will complete some signals like SIGHUP and SIGUSR1.
Enjoy working with docker-compose faster and with less typos! Enjoy working with Compose faster and with less typos!

View File

@ -43,16 +43,16 @@ See the [`docker-compose.yml` reference](yml.html) for more information on how i
We can now start a Django project using `docker-compose run`: We can now start a Django project using `docker-compose run`:
$ docker-compose run web django-admin.py startproject docker-composeexample . $ docker-compose run web django-admin.py startproject composeexample .
First, Compose will build an image for the `web` service using the `Dockerfile`. It will then run `django-admin.py startproject docker-composeexample .` inside a container using that image. First, Compose will build an image for the `web` service using the `Dockerfile`. It will then run `django-admin.py startproject composeexample .` inside a container using that image.
This will generate a Django app inside the current directory: This will generate a Django app inside the current directory:
$ ls $ ls
Dockerfile docker-compose.yml docker-composeexample manage.py requirements.txt Dockerfile docker-compose.yml composeexample manage.py requirements.txt
First thing we need to do is set up the database connection. Replace the `DATABASES = ...` definition in `docker-composeexample/settings.py` to read: First thing we need to do is set up the database connection. Replace the `DATABASES = ...` definition in `composeexample/settings.py` to read:
DATABASES = { DATABASES = {
'default': { 'default': {
@ -79,7 +79,7 @@ Then, run `docker-compose up`:
myapp_web_1 | myapp_web_1 |
myapp_web_1 | 0 errors found myapp_web_1 | 0 errors found
myapp_web_1 | January 27, 2014 - 12:12:40 myapp_web_1 | January 27, 2014 - 12:12:40
myapp_web_1 | Django version 1.6.1, using settings 'docker-composeexample.settings' myapp_web_1 | Django version 1.6.1, using settings 'composeexample.settings'
myapp_web_1 | Starting development server at http://0.0.0.0:8000/ myapp_web_1 | Starting development server at http://0.0.0.0:8000/
myapp_web_1 | Quit the server with CONTROL-C. myapp_web_1 | Quit the server with CONTROL-C.

View File

@ -1,10 +1,8 @@
--- ---
layout: default layout: default
title: Compose | Fast, isolated development environments using Docker title: Compose: Multi-container orchestration for Docker
--- ---
<strong class="strapline">Fast, isolated development environments using Docker.</strong>
Define your app's environment with a `Dockerfile` so it can be reproduced anywhere: Define your app's environment with a `Dockerfile` so it can be reproduced anywhere:
FROM python:2.7 FROM python:2.7
@ -28,9 +26,7 @@ db:
(No more installing Postgres on your laptop!) (No more installing Postgres on your laptop!)
Then type `docker-compose up`, and Compose will start and run your entire app: Then type `docker-compose up`, and Compose will start and run your entire app.
![example docker-compose run](https://orchardup.com/static/images/docker-compose-example-large.gif)
There are commands to: There are commands to:
@ -49,8 +45,8 @@ First, [install Docker and Compose](install.html).
You'll want to make a directory for the project: You'll want to make a directory for the project:
$ mkdir docker-composetest $ mkdir composetest
$ cd docker-composetest $ cd composetest
Inside this directory, create `app.py`, a simple web app that uses the Flask framework and increments a value in Redis: Inside this directory, create `app.py`, a simple web app that uses the Flask framework and increments a value in Redis:
@ -108,8 +104,8 @@ Now if we run `docker-compose up`, it'll pull a Redis image, build an image for
$ docker-compose up $ docker-compose up
Pulling image redis... Pulling image redis...
Building web... Building web...
Starting docker-composetest_redis_1... Starting composetest_redis_1...
Starting docker-composetest_web_1... Starting composetest_web_1...
redis_1 | [8] 02 Jan 18:43:35.576 # Server started, Redis version 2.8.3 redis_1 | [8] 02 Jan 18:43:35.576 # Server started, Redis version 2.8.3
web_1 | * Running on http://0.0.0.0:5000/ web_1 | * Running on http://0.0.0.0:5000/
@ -118,13 +114,13 @@ The web app should now be listening on port 5000 on your docker daemon (if you'r
If you want to run your services in the background, you can pass the `-d` flag to `docker-compose up` and use `docker-compose ps` to see what is currently running: If you want to run your services in the background, you can pass the `-d` flag to `docker-compose up` and use `docker-compose ps` to see what is currently running:
$ docker-compose up -d $ docker-compose up -d
Starting docker-composetest_redis_1... Starting composetest_redis_1...
Starting docker-composetest_web_1... Starting composetest_web_1...
$ docker-compose ps $ docker-compose ps
Name Command State Ports Name Command State Ports
------------------------------------------------------------------- -------------------------------------------------------------------
docker-composetest_redis_1 /usr/local/bin/run Up composetest_redis_1 /usr/local/bin/run Up
docker-composetest_web_1 /bin/sh -c python app.py Up 5000->5000/tcp composetest_web_1 /bin/sh -c python app.py Up 5000->5000/tcp
`docker-compose run` allows you to run one-off commands for your services. For example, to see what environment variables are available to the `web` service: `docker-compose run` allows you to run one-off commands for your services. For example, to see what environment variables are available to the `web` service:
@ -137,4 +133,4 @@ If you started Compose with `docker-compose up -d`, you'll probably want to stop
$ docker-compose stop $ docker-compose stop
That's more-or-less how Compose works. See the reference section below for full details on the commands, condocker-composeuration file and environment variables. If you have any thoughts or suggestions, [open an issue on GitHub](https://github.com/docker/docker-compose). That's more-or-less how Compose works. See the reference section below for full details on the commands, configuration file and environment variables. If you have any thoughts or suggestions, [open an issue on GitHub](https://github.com/docker/docker-compose).

View File

@ -8,7 +8,7 @@ Installing Compose
First, install Docker version 1.3 or greater. First, install Docker version 1.3 or greater.
If you're on OS X, you can use the [OS X installer](https://docs.docker.com/installation/mac/) to install both Docker and boot2docker. Once boot2docker is running, set the environment variables that'll condocker-composeure Docker and Compose to talk to it: If you're on OS X, you can use the [OS X installer](https://docs.docker.com/installation/mac/) to install both Docker and boot2docker. Once boot2docker is running, set the environment variables that'll configure Docker and Compose to talk to it:
$(boot2docker shellinit) $(boot2docker shellinit)

View File

@ -25,7 +25,7 @@ Next, we have a bootstrap `Gemfile` which just loads Rails. It'll be overwritten
source 'https://rubygems.org' source 'https://rubygems.org'
gem 'rails', '4.0.2' gem 'rails', '4.0.2'
Finally, `docker-compose.yml` is where the magic happens. It describes what services our app comprises (a database and a web app), how to get each one's Docker image (the database just runs on a pre-made PostgreSQL image, and the web app is built from the current directory), and the condocker-composeuration we need to link them together and expose the web app's port. Finally, `docker-compose.yml` is where the magic happens. It describes what services our app comprises (a database and a web app), how to get each one's Docker image (the database just runs on a pre-made PostgreSQL image, and the web app is built from the current directory), and the configuration we need to link them together and expose the web app's port.
db: db:
image: postgres image: postgres
@ -50,8 +50,8 @@ First, Compose will build the image for the `web` service using the `Dockerfile`
$ ls $ ls
Dockerfile app docker-compose.yml tmp Dockerfile app docker-compose.yml tmp
Gemfile bin lib vendor Gemfile bin lib vendor
Gemfile.lock condocker-compose log Gemfile.lock config log
README.rdoc condocker-compose.ru public README.rdoc config.ru public
Rakefile db test Rakefile db test
Uncomment the line in your new `Gemfile` which loads `therubyracer`, so we've got a Javascript runtime: Uncomment the line in your new `Gemfile` which loads `therubyracer`, so we've got a Javascript runtime:
@ -94,5 +94,3 @@ Finally, we just need to create the database. In another terminal, run:
$ docker-compose run web rake db:create $ docker-compose run web rake db:create
And we're rolling—your app should now be running on port 3000 on your docker daemon (if you're using boot2docker, `boot2docker ip` will tell you its address). And we're rolling—your app should now be running on port 3000 on your docker daemon (if you're using boot2docker, `boot2docker ip` will tell you its address).
![Screenshot of Rails' stock index.html](https://orchardup.com/static/images/docker-compose-rails-screenshot.png)

View File

@ -37,7 +37,7 @@ db:
MYSQL_DATABASE: wordpress MYSQL_DATABASE: wordpress
``` ```
Two supporting files are needed to get this working - first up, `wp-condocker-compose.php` is the standard Wordpress condocker-compose file with a single change to point the database condocker-composeuration at the `db` container: Two supporting files are needed to get this working - first up, `wp-config.php` is the standard Wordpress config file with a single change to point the database configuration at the `db` container:
``` ```
<?php <?php

View File

@ -60,7 +60,7 @@ Environment variables will also be created - see the [environment variable refer
### external_links ### external_links
Link to containers started outside this `docker-compose.yml` or even outside of docker-compose, especially for containers that provide shared or common services. Link to containers started outside this `docker-compose.yml` or even outside of Compose, especially for containers that provide shared or common services.
`external_links` follow semantics similar to `links` when specifying both the container name and the link alias (`CONTAINER:ALIAS`). `external_links` follow semantics similar to `links` when specifying both the container name and the link alias (`CONTAINER:ALIAS`).
``` ```
@ -103,7 +103,7 @@ Mount paths as volumes, optionally specifying a path on the host machine
volumes: volumes:
- /var/lib/mysql - /var/lib/mysql
- cache/:/tmp/cache - cache/:/tmp/cache
- ~/condocker-composes:/etc/condocker-composes/:ro - ~/configs:/etc/configs/:ro
``` ```
### volumes_from ### volumes_from