玩转 Docker 容器技术:1-6章 实验报告
安装Docker
配置 Docker 的 apt 源
安装包,允许 apt 命令 HTTPS 访问 Docker 源。
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
添加 Docker 官方的 GPG
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
将 Docker 的源添加到 /etc/apt/sources.list
$ sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"
安装docker
$ sudo apt-get update
$ sudo apt-get install docker-ce
运行第一个容器
运行容器
$ sudo docker run -d -p 80:80 httpd
查看下载的httpd镜像
$ sudo docker images
查看正在运行的容器
$ sudo docker ps
镜像
hello-world镜像
下载hello-world镜像
$ sudo docker pull hello-world