compose 工具是一个批量
工具,用于运行和管理多个docker
容器。
- 在 Mac/Windows中,已经集成了
docker-compose
命令 - 在WindowsServer中
先启动powershell
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
然后运行如下命令
Invoke-WebRequest "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-Windows-x86_64.exe" -UseBasicParsing -OutFile $Env:ProgramFiles\Docker\docker-compose.exe
然后测试下 docker-compose --version
- Linux中:
# 下载docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# 给与执行权限
sudo chmod +x /usr/local/bin/docker-compose
# 测试命令
docker-compose --version