栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

Docker 学习笔记 与常用指令

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Docker 学习笔记 与常用指令

docker --help 可以列出所有docker指令
docker image --help 可以列出所有docker 镜像指令
----docker 镜像管理— docker image command(有很多命令可以把
docker info

build Build an image from a Dockerfile
history Show the history of an image
import Import the contents from a tarball to create a filesystem image
inspect Display detailed information on one or more images
load Load an image from a tar archive or STDIN
ls List images
prune Remove unused images
pull Pull an image or a repository from a registry
push Push an image or a repository to a registry
rm Remove one or more images
save Save one or more images to a tar archive (streamed to STDOUT by default)
tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE

docker image ls 列出本地镜像
docker history gonivinck_mysql 列出构建镜时用到的部骤
docker inspect gonivinck_mysql 列出建镜像详细信息
docker pull gonivinck_mysql 下载镜像

----docker 容器管理----
docker container ps 列出当前有哪些启动容器 docker container ps -a 列出所有容器 docker container ps -q 列出所有容器ID

docker container ps l 列出最新创建的容器

docker exec -it gonivinck_mysql_1 bash 进入对应容器

docker exec web(容器名) ls 不进入容器直接运行命令(免交互执行)

docker commit 创建一个新镜像来至于一个容器

docker port gonivinck_mysql_1 显示容器暴露的端口

docker top gonivinck_mysql_1 查看容器里面的进程

docker stats gonivinck_mysql_1 查看容器运行状态 docker stats gonivinck_mysql_1 --no-stream

docker stop/start/restart gonivinck_mysql_1 停止/启动/重启容器

docker container prune 移除所有已停止的容器

docker rm -f $(docker ps -qa) 移除所有容器

什么是 Dockerfile?
Dockerfile 是一个用来构建镜像的文本文件,文本内容包含了一条条构建镜像所需的指令和说明。
构建和启动运行我们的服务容器
docker-compose up -d

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/939657.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号