0
点赞
收藏
分享

微信扫一扫

docker学习笔记(2)-docker基础入门操作


查找nginx在配置的镜像源

[root@VM_0_16_centos nginx]# docker search nginx 查找nginx在配置的镜像源

docker学习笔记(2)-docker基础入门操作_容器

拉取nginx最新版本镜像

[root@VM_0_16_centos nginx]# docker pull nginx:latest 拉取nginx最新版本镜像

docker学习笔记(2)-docker基础入门操作_centos_02

查看本地镜像

[root@VM_0_16_centos nginx]# docker images  查看本地镜像

docker学习笔记(2)-docker基础入门操作_centos_03

运行镜像

[root@VM_0_16_centos nginx]# docker run -d -p 80:80 --name nginx01 nginx  后台模式运行容器

运行成功返回容器ID

docker学习笔记(2)-docker基础入门操作_centos_04

查看运行的镜像

[root@VM_0_16_centos nginx]# docker ps 查看运行的镜像

docker学习笔记(2)-docker基础入门操作_容器_05

停止运行的镜像

[root@VM_0_16_centos nginx]# docker stop 41e18aacdc4f

docker学习笔记(2)-docker基础入门操作_容器_06

删除容器(必须停止容器后再删除 或者-f)

[root@VM_0_16_centos nginx]# docker rm -f 41e18aacdc4f

docker学习笔记(2)-docker基础入门操作_容器_07

进入容器内部

[root@VM_0_16_centos nginx]# docker exec -it e5c05d72b1d3 /bin/bash

docker学习笔记(2)-docker基础入门操作_centos_08


进去的系统是阉割版的linux系统,很多命令用不了

复制宿主机的文件到容器内部 或者 反转

[root@VM_0_16_centos nginx]# docker cp /data/nginxconf/ 70da07c8137d:/data/

docker学习笔记(2)-docker基础入门操作_docker_09


docker学习笔记(2)-docker基础入门操作_nginx_10


docker学习笔记(2)-docker基础入门操作_运维_11


举报

相关推荐

0 条评论