国内安装docker

apt remove docker docker-engine docker.io containerd runc 
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun 
echo '{"registry-mirrors":["https://reg-mirror.qiniu.com/"]}' > /etc/docker/daemon.json
systemctl daemon-reload 
systemctl restart docker 
docker info 
curl -L https://get.daocloud.io/docker/compose/releases/download/1.28.5/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose 
chmod +x /usr/local/bin/docker-compose 
docker-compose --version 

清空docker日志

truncate -s 0 /var/lib/docker/containers/*/*-json.log

删除所有容器和卷

docker rm -f $(docker ps -a -q) &&docker volume rm $(docker volume ls -q)

过滤查看日志

docker-compose logs --follow --tail=1|grep "get your Goerli ETH" 

根据镜像删除docker

docker rm $(docker stop $(docker ps -a -q --filter ancestor=ethersphere/bee:0.6.2 --format="{{.ID}}"))

查看运行中的docker的启动命令

alias runlike="docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:ro assaflavie/runlike"
docker ps
runlike YOUR-CONTAINER 

标签: none

添加新评论