Merge pull request #2936 from dnephin/update_docs_for_161

Update docs, fix broken link, use v2 compose file format
This commit is contained in:
Daniel Nephin 2016-02-17 13:34:39 -05:00
commit d4f2f54cf8
5 changed files with 55 additions and 46 deletions

View File

@ -626,7 +626,7 @@ While it is possible to declare volumes on the fly as part of the service
declaration, this section allows you to create named volumes that can be declaration, this section allows you to create named volumes that can be
reused across multiple services (without relying on `volumes_from`), and are reused across multiple services (without relying on `volumes_from`), and are
easily retrieved and inspected using the docker command line or API. easily retrieved and inspected using the docker command line or API.
See the [docker volume](http://docs.docker.com/reference/commandline/volume/) See the [docker volume](/engine/reference/commandline/volume_create.md)
subcommand documentation for more information. subcommand documentation for more information.
### driver ### driver

View File

@ -72,6 +72,8 @@ and a `docker-compose.yml` file.
9. Add the following configuration to the file. 9. Add the following configuration to the file.
version: '2'
services:
db: db:
image: postgres image: postgres
web: web:
@ -81,7 +83,7 @@ and a `docker-compose.yml` file.
- .:/code - .:/code
ports: ports:
- "8000:8000" - "8000:8000"
links: depends_on:
- db - db
This file defines two services: The `db` service and the `web` service. This file defines two services: The `db` service and the `web` service.

View File

@ -95,13 +95,16 @@ Define a set of services using `docker-compose.yml`:
1. Create a file called docker-compose.yml in your project directory and add 1. Create a file called docker-compose.yml in your project directory and add
the following: the following:
version: '2'
services:
web: web:
build: . build: .
ports: ports:
- "5000:5000" - "5000:5000"
volumes: volumes:
- .:/code - .:/code
links: depends_on:
- redis - redis
redis: redis:
image: redis image: redis

View File

@ -49,6 +49,8 @@ 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 needed the web app is built from the current directory), and the configuration needed
to link them together and expose the web app's port. to link them together and expose the web app's port.
version: '2'
services:
db: db:
image: postgres image: postgres
web: web:
@ -58,7 +60,7 @@ to link them together and expose the web app's port.
- .:/myapp - .:/myapp
ports: ports:
- "3000:3000" - "3000:3000"
links: depends_on:
- db - db
### Build the project ### Build the project

View File

@ -41,12 +41,14 @@ and WordPress.
Next you'll create a `docker-compose.yml` file that will start your web service Next you'll create a `docker-compose.yml` file that will start your web service
and a separate MySQL instance: and a separate MySQL instance:
version: '2'
services:
web: web:
build: . build: .
command: php -S 0.0.0.0:8000 -t /code command: php -S 0.0.0.0:8000 -t /code
ports: ports:
- "8000:8000" - "8000:8000"
links: depends_on:
- db - db
volumes: volumes:
- .:/code - .:/code