1创建目录dl2
Cd dl2
Touch dockerfile
Touch index,html
2ROM ubuntu
MAINTAINER xbf
RUN sed -i ‘s/archive.ubuntu.com/mirrors.ustc.edu.cn/g’ /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y nginx
COPY index.html /var/www/html
ENTRYPOINT ["/usr/sbin/nginx"."-g".“daemon off;”]
EXPOSE 80
3vi index.html
随意写写hjaskgdsgfgahs
docker build -t xbf/hello-nginx
4docker run -d -p 80:80 xbf/hello-nginx
5 netstat -nap | grep 80
Kill -9 28006
6成功
7curl http://192.168.30.129
8成功