sudo docker images
参数 | 描述 |
---|
-a | 中间层镜像 |
-q | 只显示id |
–digests | 镜像摘要信息 |
–no-trunc | 镜像完整信息 |
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest 4ab4c602aa5e 2 months ago 1.84kB
字段 | 说明 |
---|
REPOSITORY | 表示镜像的仓库资源 |
TAG | 标签 |
IMAGE ID | ID |
CREATED | 创建时间 |
SIZE | 大小 |
docker search image_name
参数|描述
--|--
-s 30|点赞数超过30的
--no-trunc|展示摘要
--automated|
docker pull image_name:tag //默认tag是lastest,而且会把中间镜像自动下载下来
docker rmi image_name:tag //默认tag是lastest,而且会把中间镜像删除
docker rmi -f $(docker images -qa) //删除所有
指定docker的端口
docker run -it -p 8888:8080 tomcat //端口映射,将docker的8888端口映射到8080,在宿主上访问8888端口容器直接打开容器的8080端口的tomcat
docker run -it -P tomcat //端口随机映射
docker run -d -p 6666:8080 tomcat
docker commit
docker commit -m '说明信息' -a '提交人' 容器id 新镜像名字
docker commit -a='user' -m='test' 8faf9g9ssad namespace/mytomcat:1.2