Docker实验报告
Docker安装 输入以下命令即可在Ubuntu18.04上配置Docker: sudo apt-get install apt-transport-https ca-certificates curl software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" sudo apt-get update sudo apt-get install docker-ce 容器运行 环境就绪,马上运行第一个容器,执行命令: sudo docker run -d -p 1998:80 httpd 此时打开浏览器输入对应端口地址http://localhost:1998即可: hello-world 输入以下命令即可运行hello-world: sudo docker pull hello-world sudo docker run hello-world 构建镜像 首先,新建Dockfile,其内容如下: FROM ubuntu