Docker-compose layout tool installation

Introduction

YAML file formats and write precautions
YAML markup language is a very intuitive data serialization format, high readability, similar to the XML data description language, grammar lot simpler than XML.
YAML data structure to represent the continuous item is represented by a minus sign, key-value pairs separated by a colon, enclosed in square brackets array, hash enclosed in braces by indenting.

YAML file format Note:
1. does not support tabs, tab key to indent, you need to use spaces to indent
2. usually begins with two spaces to indent
3. Indent a space character, such as colon, comma, crossbar
4 . Note pound sign
5. If special characters enclosed in single quotes cause
6. Boolean value (true, false, yes, no , on, off) must be enclosed in quotes, so that they will be interpreted as a string parser

Download-Compose Docker
mkdir / Home / Tools -p

# docker compose 1.18.0 的 SHA-256 sum 值:
# b2f2c3834107f526b1d9cc8d8e0bdd132c6f1495b036a32cbc61b5288d2e2a01 

cd /home/tools
curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose

sha256sum /usr/local/bin/docker-compose

# With SHA-256 sum value above comparison confirm the command is complete

# Gives execute permissions
chmod + x / usr / local / bin / docker-compose

# View the version number:
Docker-Compose --version

Common name
# operation, using a docker-compose.yml in the current default directory
docker-compose up

# If you do not use the default yml, can be used to specify -f, -d runs in the background
docker-compose -f test.yml up -d

# View container running, only support the current docker-compose.yml file in the directory
docker-compose ps

# Restart all containers only support the current docker-compose.yml file in the directory
docker-compose restart

# Restart App1
Docker-Compose restart App1 

# To stop all vessels, only support the current docker-compose.yml file in the directory
docker-compose stop

# Stop App1
Docker Compose-STOP App1 

For example:
CAT-compose.yml Docker

networks:
  backend:
    external:
      name: backend

-----

cat .env

IMAGE_NAME=flash-sale:2018-07-31_21-33

Guess you like

Origin www.linuxidc.com/Linux/2019-08/160026.htm
Recommended