docker下运行nginx镜像
作者:互联网
一、获取Nginx镜像
#docker pull nginx
三、在终端中运行如下命令,在本机9001端口运行Nginx服务器,docker ps 查看刚才运行的 container 的id
#docker run -p 9001:80 -d nginx
#docker ps
[root@server01 ~]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d79bbc7bc03d nginx "/docker-entrypoint.…" 30 seconds ago Up 29 seconds 0.0.0.0:9001->80/tcp busy_edison
进入镜像内部(exit或者ctrl+d退出)
root@server01 ~]# docker exec -it busy_edison /bin/bash root@d79bbc7bc03d:/# ls bin boot dev docker-entrypoint.d docker-entrypoint.sh etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var
修改容器内部nginx下的html文件
[root@server01 ~]# docker cp index.html busy_edison://usr/share/nginx/html
标签:ps,edison,nginx,server01,镜像,docker,root 来源: https://www.cnblogs.com/liujunjun/p/14247630.html