docker 制作centos lnmp 开发镜像
搜索下载centos7 的镜像
[root@iZbp12nyvj1faz8f0boyo1Z soft]# docker search centos7 [root@iZbp12nyvj1faz8f0boyo1Z soft]# docker pull centos:centos7
查看本地docker镜像
[root@iZbp12nyvj1faz8f0boyo1Z soft]# docker images
以进程方式允许docker centos7容器
[root@iZbp12nyvj1faz8f0boyo1Z soft]# docker run -itd -p 80:80 --name buysell b5b4d78bc90c /bin/sh -c "while true; do echo hello world; sleep 1; done" 07f1151915a29612533fb91fff66b087ebb379763527d85b56ccc678a6258214 [root@iZbp12nyvj1faz8f0boyo1Z soft]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 07f1151915a2 b5b4d78bc90c "/bin/sh -c 'while t…" 3 seconds ago Up 2 seconds 0.0.0.0:80->80/tcp buysell [root@iZbp12nyvj1faz8f0boyo1Z soft]#
进入buysell容器
[root@iZbp12nyvj1faz8f0boyo1Z soft]# docker exec -it buysell bash [root@07f1151915a2 /]# ls anaconda-post.log bin dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var [root@07f1151915a2 /]#