码迷,mamicode.com
首页 > 其他好文 > 详细

docker入门教程(二)基础命令

时间:2018-05-25 21:14:23      阅读:121      评论:0      收藏:0      [点我收藏+]

标签:arp   dock   tar   mat   name   创建   php   gis   images   

1.配置docker加速器

[root@docker docker]# tee /etc/docker/daemon.json <<- EOF
{
  "registry-mirrors": ["https://registry.docker-cn.com"]
}
EOF

 

1.11启动第一个容器

docker run -d -p 80:80 nginx

run 创建并运行一个容器

-d   后台运行

-p  端口映射

nginx  镜像名称

1.12docker基础操作

1.查看镜像列表  docker image ls  or docker images

[root@docker1 ~]# docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE nginx latest ae513a47849c 3 weeks ago 109MB centos latest ff426288ea90 4 months ago 207MB
2.搜索镜像
docker search 镜像名
[root@docker1 ~]# docker search nginx
NAME                                                   DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
nginx                                                  Official build of Nginx.                        8564                [OK]                
jwilder/nginx-proxy                                    Automated Nginx reverse proxy for docker con…   1335                                    [OK]
richarvey/nginx-php-fpm                                Container running Nginx + PHP-FPM capable of…   547                                     [OK]
3.下载镜像 docker pull

 

docker入门教程(二)基础命令

标签:arp   dock   tar   mat   name   创建   php   gis   images   

原文地址:https://www.cnblogs.com/mclzy/p/9090140.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!