Docker常用命令行

AI摘要

常用Docker命令汇总,包括镜像管理、容器操作及系统控制,如查看镜像、启停容器、推送镜像和重启服务等。

作用命令行
查看docker信息 decker version
docker info
搜索镜像 docker search (image-name)
查看镜像的历史版本 docker history (image-name)
将镜像推送到registry docker push (image-name)
删除镜像 docker rmi <image id>
修改镜像的tag标签 docker tag image-id imagename:tag
从tar文件中载入镜像 docker load -i test.tar
查看镜像 docker images
关闭运行中的容器 docker stop ID(或者容器名字)
开启容器 docker start ID
重启运行中的容器 docker restart ID
移除容器(先关闭再删除) docker rm ID
杀死容器的主进程 docker kill [options] container
停止所有container docker stop $(docker ps -a -q)
移除所有container docker rm $(docker ps -a -q)
重启docker sudo systemctl restart docker
守护进程重启 sudo systemctl daemon-reload
关闭docker sudo systemctl stop docker

Saiyintai

软件测试工程师

相关推荐

Docker 设置网络代理

Docker Compose因网络超时更新失败,错误为请求Docker仓库时连接被取消。解决方法是在`/etc/docker/daemon.json`中配置HTTP和HTTPS代理为`http://127.0.0.1:7897`,并重启Docker服务。

停止并删除dockers 网络

Ubuntu 24.04部署ai-manus存在安全风险,因无用户登录功能。关闭容器时网络被占用,需先停止相关容器再执行docker compose down。项目功能达manus的80%,但消耗tokens过多。

暂无评论