7,540
edits
Changes
Docker
,→docker-compose.yml syntax
* '''build''': In version 1 file format, build is different in two ways:
** The object form is allowed in Version 2 and up.
** Using In version 1, using build together with image is not allowed. Attempting to do so results in an error.** From version 3, if you specify image as well as build, then Compose names the built image with the webapp and optional tag specified in image
** Note: This option is ignored when deploying a stack in swarm mode with a (version 3) Compose file. The docker stack command accepts only pre-built images.
<pre>
version: '3'
services:
webapp:
build:
context: ./dir
dockerfile: Dockerfile-alternate
</pre>