首页 > 系统 > CentOS > 正文

centos7上安装DUCKER并配置

2024-06-28 16:00:39
字体:
来源:转载
供稿:网友
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

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表