ES 筆記二:docer-compose 的安裝以及編排檔案

CrazyZard發表於2019-10-10

1.下載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

2.修改檔案的執行許可權

sudo chmod +x /usr/local/bin/docker-compose

3.檢視compose的版本

docker-compose version

相關閱讀

如果宿主機的9000埠被佔用,記得改ports的地址哦

映象加速

PS:映象地址是我阿里雲的,慢點的話換一個

vim /etc/docker/daemon.json
{ 
“registry-mirrors”: [“https://rlkv9m88.mirror.aliyuncs.com“] 
}
systemctl daemon-reload
systemctl restart docker

相關引數


#啟動
docker-compose up

docker-compose down

docker-compose down -v

docker ps
docker stop Name/ContainerId
docker start Name/ContainerId

$docker rm Name/ID
-f, –force=false; -l, –link=false Remove the specified link and not the underlying container; -v, –volumes=false Remove the volumes associated to the container

$docker rm docker ps -a -q
停止、啟動、殺死、重啟一個容器
$docker stop Name/ID
$docker start Name/ID
$docker kill Name/ID
$docker restart name/ID

相關文章