Stop referring to deprecated 'links' feature, replace with 'depends_on' where appropriate (#9480)

This commit is contained in:
Psy-Q 2019-09-26 17:37:02 +02:00 committed by Usha Mandya
parent 996f2e7d43
commit 25218530a6
1 changed files with 9 additions and 9 deletions

View File

@ -62,7 +62,7 @@ services.
web: web:
image: example/my_web_app:latest image: example/my_web_app:latest
links: depends_on:
- db - db
- cache - cache
@ -136,7 +136,7 @@ Start with a **docker-compose.yml**.
web: web:
image: example/my_web_app:latest image: example/my_web_app:latest
links: depends_on:
- db - db
db: db:
@ -147,7 +147,7 @@ export or backup.
dbadmin: dbadmin:
build: database_admin/ build: database_admin/
links: depends_on:
- db - db
To start a normal environment run `docker-compose up -d`. To run a database To start a normal environment run `docker-compose up -d`. To run a database
@ -177,9 +177,9 @@ is useful if you have several services that reuse a common set of configuration
options. Using `extends` you can define a common set of service options in one options. Using `extends` you can define a common set of service options in one
place and refer to it from anywhere. place and refer to it from anywhere.
Keep in mind that `links`, `volumes_from`, and `depends_on` are never shared Keep in mind that `volumes_from` and `depends_on` are never shared between
between services using `extends`. These exceptions exist to avoid implicit services using `extends`. These exceptions exist to avoid implicit
dependencies; you always define `links` and `volumes_from` locally. This ensures dependencies; you always define `volumes_from` locally. This ensures
dependencies between services are clearly visible when reading the current file. dependencies between services are clearly visible when reading the current file.
Defining these locally also ensures that changes to the referenced file don't Defining these locally also ensures that changes to the referenced file don't
break anything. break anything.
@ -233,7 +233,7 @@ You can also write other services and link your `web` service to them:
environment: environment:
- DEBUG=1 - DEBUG=1
cpu_shares: 5 cpu_shares: 5
links: depends_on:
- db - db
db: db:
image: postgres image: postgres
@ -264,7 +264,7 @@ common configuration:
command: /code/run_web_app command: /code/run_web_app
ports: ports:
- 8080:8080 - 8080:8080
links: depends_on:
- queue - queue
- db - db
@ -273,7 +273,7 @@ common configuration:
file: common.yml file: common.yml
service: app service: app
command: /code/run_worker command: /code/run_worker
links: depends_on:
- queue - queue
## Adding and overriding configuration ## Adding and overriding configuration