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]
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