docker基础

 1, 基于centos镜像,创建container并进入

docker run -it --privileged=true --name webserver2 -p 8888:80 centos /sbin/init

 

2, 安装并启动nginx
yum install nginx
systemctl start nginx.service
systemctl enable nginx.service

 

3, 访问
http://192.168.56.249:8888/

posted @ 2021-03-15 13:38  Ready!  阅读(70)  评论(0编辑  收藏  举报