课程: Learning Docker Compose

今天就学习课程吧!

今天就开通帐号,24,100 门业界名师课程任您挑!

Writing a Docker Compose configuration

Writing a Docker Compose configuration - Docker教程

课程: Learning Docker Compose

Writing a Docker Compose configuration

- [Instructor] To get started using Docker Compose, the first step is to create a configuration file inside the application directory. Every Docker Compose configuration must be in a YAML file format and be saved under the file name, docker-compose.yaml. YAML stands for yet another markup language, and is a standard syntax for data serialization. If you're familiar with JSON, they're very similar. Many other configuration as code tools use YAML syntax as well. Inside the Docker Compose YAML file, typically the first line will specify which version of Docker Compose is being used. This will depend on which version of Docker you're running, but for the sake of this example, we can assume both Docker and Docker Compose are recent versions. Next, the keyword, services, is used to specify all of the containers the application needs to run. An indentation of either tabs or spaces will denote that the next line belongs inside…

内容