Last login: Tue Feb 7 15:17:32 2017//安裝docker[root@localhost ~]# yum install docker Complete!//啟動docker[root@localhost ~]# systemctl start docker.service//配置開機自啟動docker[root@localhost ~]# systemctl enable docker.serviceCreated symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.//查詢運行的docker鏡像[root@localhost ~]# docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES//查詢官方docker hub 的鏡像[root@localhost ~]# docker search MySQLINDEX NAME DESCRipTION STARS OFFICIAL AUTOMATEDdocker.io docker.io/mysql MySQL is a widely used, open-source relati... 3815 [OK] docker.io docker.io/mysql/mysql-server Optimized MySQL Server Docker images. Crea... 253 [OK]docker.io docker.io/centurylink/mysql Image containing mysql. Optimized to be li... 48 [OK]docker.io docker.io/sameersbn/mysql 41 [OK]docker.io docker.io/zabbix/zabbix-server-mysql Zabbix Server with MySQL database support 25 [OK]docker.io docker.io/appcontainers/mysql Centos/Debian Based Customizable MySQL Con... 8 [OK]docker.io docker.io/marvambass/mysql MySQL Server based on Ubuntu 14.04 7 [OK]docker.io docker.io/dnhsoft/mysql-utf8 Inherits the official MySQL image configur... 5 [OK]docker.io docker.io/alterway/mysql Docker Mysql 3 [OK]docker.io docker.io/bitnami/mysql Bitnami MySQL Docker Image 3 [OK]docker.io docker.io/frodenas/mysql A Docker Image for MySQL 3 [OK]docker.io docker.io/drupaldocker/mysql MySQL for Drupal 2 [OK]docker.io docker.io/yfix/mysql Yfix docker built mysql 2 [OK]docker.io docker.io/coscale/mysql CoScale custom configuration of the offici... 1 [OK]docker.io docker.io/debezium/example-mysql Example MySQL database server with a simpl... 1 [OK]docker.io docker.io/lysender/mysql MySQL base image using Ubuntu 16.04 Xenial 1 [OK]docker.io docker.io/newrelic/mysql-plugin New Relic Plugin for monitoring MySQL data... 1 [OK]docker.io docker.io/tozd/mysql MySQL (MariaDB fork) Docker image. 1 [OK]docker.io docker.io/xalt/mysql Mysql with special Atlassian configuration... 1 [OK]docker.io docker.io/1maa/mysql MySQL database 0 [OK]docker.io docker.io/captomd/mysql CaptoMD mysql configuration 0 [OK]docker.io docker.io/cloudposse/mysql ImPRoved `mysql` service with support for ... 0 [OK]docker.io docker.io/datajoint/mysql MySQL image pre-configured to work smoothl... 0 [OK]docker.io docker.io/nanobox/mysql MySQL service for nanobox.io 0 [OK]docker.io docker.io/projectomakase/mysql Docker image for MySQL 0 [OK]//配置國內daocloud提供的docker hub 加速[root@localhost ~]# curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://67c8ec85.m.daocloud.io{"registry-mirrors": ["http://67c8ec85.m.daocloud.io"], "live-restore": true}Success.You need to restart docker to take effect: sudo systemctl restart docker //重啟docker[root@localhost ~]# sudo systemctl restart docker //下載docker鏡像[root@localhost ~]# docker pull mysqlUsing default tag: latestTrying to pull repository docker.io/library/mysql ... latest: Pulling from docker.io/library/mysql5040bd298390: Pull complete 55370df68315: Pull complete fad5195d69cc: Pull complete a1034a5fbbfc: Pull complete 17f3570b42ae: Pull complete 6bf4b16e5339: Pull complete 9700c9731729: Pull complete f2fea9c5b632: Pull complete 2f8101f5336d: Pull complete 0dc8f8a1031a: Pull complete a1b9627588c7: Pull complete Digest: sha256:84c80bb229e8cbcda748a05e99bc4c999df10d9ffd30e41e86e60e4fb13aa6da//查詢本地已有docker鏡像[root@localhost ~]# docker images mysqlREPOSITORY TAG IMAGE ID CREATED SIZEdocker.io/mysql latest 7666f75adb6b 10 days ago 405.6 MB//運行docker容器[root@localhost ~]# docker run -i -t mysql /bin/bashroot@a198c035b3f7:/# ps PID TTY TIME CMD 1 ? 00:00:00 bash 6 ? 00:00:00 psroot@a198c035b3f7:/# lsbin boot dev docker-entrypoint-initdb.d entrypoint.sh etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var
新聞熱點
疑難解答