Changes

Docker

78 bytes added, 21:52, 24 June 2018
docker-compose.yml syntax
- -d
</pre>
<span style="color: red>Note:</span> Setting entrypoint both overrides any default entrypoint set on the service’s image with the ENTRYPOINT Dockerfile instruction, and clears out any default command on the image - meaning that if there’s a CMD instruction in the Dockerfile, it is ignored.</span>
* '''env_file''': Add environment variables from a file. Can be a single value or a list.
<pre>
- project_db_1:postgresql
</pre>
* '''extra_hosts''': Add hostname mappings. Use the same values as the docker client --add-host parameter.
<pre>
extra_hosts:
</pre>
* '''image''': Specify the image to start the container from. Can either be a repository/tag or a partial image ID.If the image does not exist, Compose attempts to pull it
<span style="color: red>Note:</span> In the version 1 file format, using build together with image is not allowed. Attempting to do so results in an error.</span>
* '''labels''': Add metadata to containers using Docker labels. You can use either an array or a dictionary.
<pre>
* '''links''': Link to containers in another service. Either specify both the service name and a link alias (SERVICE:ALIAS), or just the service name.
<span style="color: red>Links are a legacy option. We recommend using networks instead.</span><pre>
web:
links:
- db:database
- redis
</pre>
Containers for the linked service are reachable at a hostname identical to the alias, or the service name if no alias was specified.
 
Links also express dependency between services in the same way as depends_on, so they determine the order of service startup.
 <span style="color: red>Note: If you define both links and networks, services with links between them must share at least one network in common in order to communicate.</span>