Docker 使用入门指南
1. Docker 基础操作
1.1 拉取并运行 Ubuntu 容器
当执行 docker run -t -i ubuntu:14.04 /bin/bash 时,如果本地没有 ubuntu:14.04 镜像,Docker 会自动从远程仓库拉取。拉取过程会显示每个镜像层的下载进度,拉取完成后,会进入容器的交互式终端,如下所示:
$ docker run -t -i ubuntu:14.04 /bin/bash
Unable to find image 'ubuntu:14.04' locally
ubuntu:14.04: The image you are pulling has been verified
01bf15a18638: Pull complete
30541f8f3062: Pull complete
e1cdf371fbde: Pull complete
9bd07e480c5b: Pull complete
511136ea3c5a: Already exists
Status: Downloaded newer image for ubuntu:14.04
root@6f1050d21b41:/#
退出该终端后,容器将停止运行。
1.2 以分离模式运行 Docker 容器
若想在后台运行服务,可使用 docker run 的 -d 选项,并使用 -p
超级会员免费看
订阅专栏 解锁全文
552

被折叠的 条评论
为什么被折叠?



