markdown docker-compose-cheat-sheat.md

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown docker-compose-cheat-sheat.md相关的知识,希望对你有一定的参考价值。


## Install Docker Compose on Linux distribution
Get the latest version of Docker Compose on [Docker Compose release page](https://github.com/docker/compose/releases)

To install
```
curl -L https://github.com/docker/compose/releases/download/1.17.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose --version
```

To uninstall
`sudo rm /usr/local/bin/docker-compose`

## Quick start Docker Compose
[Getting started](https://docs.docker.com/compose/gettingstarted/#step-3-define-services-in-a-compose-file)

## Some useful command with docker-compose
### Bring up services: 
* Foreground: `docker-compose up`
* Background: `docker-compose up -d`
   **Note**: When running `docker-compose` in background, you may want to stop services after you have done your work by using command: `docker-compose stop`.
   
### Bring down services:
`docker-compose down`
    Passing flag `--volumes` to remove volumes using by your containers.
   
### Specify docker-compose file
Normally, you must be inside a docker-compose project with `docker-compose.yaml` file in order to user most of `docker-compose` command, or you can use `docker-compose -f <path/to/docker-compose-file> <command>` to run command on specific docker-compose project.

### Define project name
Project name is used with your service name to create container name:
**Container Name** = **Project Name**_**Service Name**_1

By default, project name is the name of the directory which contains docker-compose file.
   

以上是关于markdown docker-compose-cheat-sheat.md的主要内容,如果未能解决你的问题,请参考以下文章

超级账本docker-compose部分介绍

区块链100例 编写脚本快速搭建超级账本 Fabric

Markdown温故知新:Markdown面面观

markdown转换为图片

转换rst到markdown总结

markdown [Markdown HowTo]作为Markdown语法的秘籍