美文网首页初见
Docker常用命令

Docker常用命令

作者: 一个番茄柿 | 来源:发表于2018-07-26 16:11 被阅读13次
通过Dockerfile构建镜像

docker build -f Dockerfile的名字 -t 镜像名称:标签 .
docker build -t ubuntu/ubuntu:16.04 .
docker build -f ubuntu.Dockerfile -t ubuntu/ubuntu:16.04 .

运行Docker镜像

docker run -it 镜像名 /bin/bash
docker run -it ubuntu/ubuntu:16.04 /bin/bash

Docker镜像推送到DockerHub上

docker push 镜像名:标签
docker push ubuntu/ubuntu:16.04

查看Docker镜像构建过程

docker history --no-trunc 镜像名称:标签

相关文章

网友评论

    本文标题:Docker常用命令

    本文链接:https://www.haomeiwen.com/subject/mdmbmftx.html