在文中,我们创建一个nginx的Docker镜像,将其运行起来后,并通过浏览器进行访问
root@ubuntu:~/myWeb# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
ubuntu 14.04 8251da35e7a7 2 weeks ago 188.4 MB
root@ubuntu:~/myWeb# docker run -i -t ubuntu:14.04 /bin/bash
root@be8438d3ddd3:/# apt-get install -y nginx
Reading package lists... Done
……………………
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
Processing triggers for sgml-base (1.26+nmu4ubuntu1) ...
root@be8438d3ddd3:/#
root@be8438d3ddd3:/# cd /usr/share/nginx/html/
root@be8438d3ddd3:/usr/share/nginx/html# ls
50x.html index.html
root@be8438d3ddd3:/usr/share/nginx/html# vi index.html
root@be8438d3ddd3:/# exit
root@ubuntu:~/myWeb#
root@ubuntu:~/myWeb#
root@ubuntu:~/myWeb# docker ps -a
CONTAINER ID IMAGE COMMAND