A Compose implementation SHOULD NOT use this version to select an exact schema to validate the Compose file, but prefer the most recent schema at the time it has been designed.
services
A Service is an abstract definition of a computing resource within an application which can be scaled/replaced independently from other components. Services are backed by a set of containers, run by the platform according to replication requirements and placement constraints. Being backed by containers, Services are defined by a Docker image and set of runtime arguments. All containers within a service are identically created with these arguments.
The short syntax variant only specifies the config name. This grants the container access to the config and mounts it at /<config_name> within the container. The source name and destination mount point are both set to the config name
short syntax的写法只需要声明config的名称,之后该config文件就会被mount在container的**/** 路径下。
propagation: the propagation mode used for the bind
create_host_path: create a directory at the source path on host if there is nothing present. Do nothing if there is something present at the path. This is automatically implied by short syntax for backward compatibility with docker-compose legacy.
selinux: the SELinux re-labeling option z (shared) or Z (private)
volume: configure additional volume options
nocopy: flag to disable copying of data from a container when a volume is created
tmpfs
: configure additional tmpfs options
size: the size for the tmpfs mount in bytes (either numeric or as bytes unit)
mode: the filemode for the tmpfs mount as Unix permission bits as an octal number
consistency: the consistency requirements of the mount. Available values are platform specific
working_dir
覆写container中由image(Dockerfile workdir)指定的工作路径
networks
用与不同容器间的互相连通
name
设置网络名称
external
设置为true表示不归compose管辖
volumes
volumes是用于存储的持久化卷
name
指定volume的名称
configs
The top-level configs declaration defines or references configuration data that can be granted to the services in this application. The source of the config is either file or external.