docker常用命令
docker search 镜像名 //查询镜像信息
[root@localhost ~]# docker search mysql
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
mysql MySQL is a widely used, open-source relation… 11145 [OK]
mariadb MariaDB Server is a high performing open sou… 4224 [OK]
mysql/mysql-server Optimized MySQL Server Docker images. Create… 829 [OK]
percona Percona Server is a fork of the MySQL relati… 547 [OK]
phpmyadmin phpMyAdmin - A web interface for MySQL and M… 274 [OK]
centos/mysql-57-centos7 MySQL 5.7 SQL database server 90
mysql/mysql-cluster Experimental MySQL Cluster Docker images. Cr… 88
centurylink/mysql Image containing mysql. Optimized to be link… 59 [OK]
databack/mysql-backup Back up mysql databases to... anywhere! 45
deitch/mysql-backup REPLACED! Please use http://hub.docker.com/r… 41 [OK]
prom/mysqld-exporter 39 [OK]
tutum/mysql Base docker image to run a MySQL database se… 35
linuxserver/mysql A Mysql container, brought to you by LinuxSe… 30
schickling/mysql-backup-s3 Backup MySQL to S3 (supports periodic backup… 29 [OK]
mysql/mysql-router MySQL Router provides transparent routing be… 21
centos/mysql-56-centos7 MySQL 5.6 SQL database server 20
docker pull 镜像名 //安装
docker run 服务名 //启动服务
docker stop 服务名//关闭服务
//服务名都可以用id代替
docker run -d -p 8080:8080 --name mytomact tomcat
-d 代表放到后台执行
-p 代表端口的映射关系 前面的8080是外部访问宿主主机的端口 后面的是docker运行服务访问的端口
–name是给镜像器起别名 mytomcat 后面跟服务名
docker images //查看本地镜像
docker ps //查看运行的镜像
docker ps -a //查看已存在的全部服务
docker restart 服务名 //重启单个服务
docker exec -it 服务名 /bin/bash //进入容器的内部
exit //退出