1. 直接通过docker拉取镜像遇到的问题:熟悉的timeout!!!

[root@localhost ~]# docker search mysql
INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED
docker.io docker.io/mysql MySQL is a widely used, open-source relati... 8073 [OK]
docker.io docker.io/mariadb MariaDB is a community-developed fork of M... 2733 [OK]
docker.io docker.io/mysql/mysql-server Optimized MySQL Server Docker images. Crea... 604 [OK]
docker.io docker.io/percona Percona Server is a fork of the MySQL rela... 430 [OK]
docker.io docker.io/zabbix/zabbix-server-mysql Zabbix Server with MySQL database support 187 [OK]
docker.io docker.io/hypriot/rpi-mysql RPi-compatible Docker Image with Mysql 113
docker.io docker.io/zabbix/zabbix-web-nginx-mysql Zabbix frontend based on Nginx web-server ... 98 [OK]
docker.io docker.io/centurylink/mysql Image containing mysql. Optimized to be li... 60 [OK]
docker.io docker.io/centos/mysql-57-centos7 MySQL 5.7 SQL database server 51
docker.io docker.io/1and1internet/ubuntu-16-nginx-php-phpmyadmin-mysql-5 ubuntu-16-nginx-php-phpmyadmin-mysql-5 50 [OK]
docker.io docker.io/mysql/mysql-cluster Experimental MySQL Cluster Docker images. ... 44
docker.io docker.io/tutum/mysql Base docker image to run a MySQL database ... 31
docker.io docker.io/zabbix/zabbix-web-apache-mysql Zabbix frontend based on Apache web-server... 27 [OK]
docker.io docker.io/bitnami/mysql Bitnami MySQL Docker Image 26 [OK]
docker.io docker.io/schickling/mysql-backup-s3 Backup MySQL to S3 (supports periodic back... 26 [OK]
docker.io docker.io/zabbix/zabbix-proxy-mysql Zabbix proxy with MySQL database support 22 [OK]
docker.io docker.io/linuxserver/mysql A Mysql container, brought to you by Linux... 20
docker.io docker.io/centos/mysql-56-centos7 MySQL 5.6 SQL database server 13
docker.io docker.io/circleci/mysql MySQL is a widely used, open-source relati... 12
docker.io docker.io/mysql/mysql-router MySQL Router provides transparent routing ... 11
docker.io docker.io/openshift/mysql-55-centos7 DEPRECATED: A Centos7 based MySQL v5.5 ima... 6
docker.io docker.io/jelastic/mysql An image of the MySQL database server main... 1
docker.io docker.io/ansibleplaybookbundle/mysql-apb An APB which deploys RHSCL MySQL 0 [OK]
docker.io docker.io/cloudposse/mysql Improved `mysql` service with support for ... 0 [OK]
docker.io docker.io/widdpim/mysql-client Dockerized MySQL Client (5.7) including Cu... 0 [OK]
[root@localhost ~]# docker pull mysql
Using default tag: latest
Trying to pull repository docker.io/library/mysql ...
latest: Pulling from docker.io/library/mysql
27833a3ba0a5: Pull complete
864c283b3c4b: Pull complete
cea281b2278b: Pull complete
8f856c14f5af: Pull complete
9c4f38c23b6f: Pull complete
1b810e1751b3: Pull complete
5479aaef3d30: Pull complete
9667974ee097: Pull complete
4ebb5e7ad6ac: Retrying in 1 second
021bd5074e22: Download complete
cce70737c123: Download complete
544ff12e028f: Download complete
Get https://registry-1.docker.io/v2/library/mysql/blobs/sha256:4ebb5e7ad6ac739b0457381dabae8d7db6f8f8b4750f9140891d91bbc9433b3f: Get https://auth.docker.io/t
oken?scope=repository%3Alibrary%2Fmysql%3Apull&service=registry.docker.io: net/http: request canceled while waiting for
connection (Client.Timeout exceeded w
hile awaiting headers
)

2. 通过国内镜像daocloud.io/library库下载,下载速度快到感人!

[root@localhost ~]#  docker pull daocloud.io/library/centos:latest
Trying to pull repository daocloud.io/library/centos ...
latest: Pulling from daocloud.io/library/centos
a02a4930cb5d: Pull complete
Digest: sha256:365fc7f33107869dfcf2b3ba220ce0aa42e16d3f8e8b3c21d72af1ee622f0cf0
Status: Downloaded newer image for daocloud.io/library/centos:latest
[root@localhost ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[root@localhost ~]# docker pull daocloud.io/library/mysql:5.7
Trying to pull repository daocloud.io/library/mysql ...
5.7: Pulling from daocloud.io/library/mysql
27833a3ba0a5: Pull complete
864c283b3c4b: Pull complete
cea281b2278b: Pull complete
8f856c14f5af: Pull complete
9c4f38c23b6f: Pull complete
1b810e1751b3: Pull complete
5479aaef3d30: Pull complete
0f1430d39d4f: Pull complete
2bc64c824b3f: Pull complete
b64ec62ca852: Pull complete
42323e351ef3: Pull complete
Digest: sha256:c7b264f4d61c1efdc3265299083cd6516c9ff45448766c766393065d4dc5d4f4
Status: Downloaded newer image for daocloud.io/library/mysql:5.7

需要注意的是:mysql镜像名的前缀不能忘记,否则报错! 
完整的名字: daocloud.io/library/mysql:5.7

sysuygm@sysuygm:~$ docker run -p 3306:3306 --name mysql2 -e MYSQL_ROOT_PASSWORD=root -d mysql:5.7
Unable to find image 'mysql:5.7' locally docker: Error response from daemon: Get https://registry-1.docker.io/v2/library/mysql/manifests/5.7: Get https://auth.docker.io/token?scope=repository%3Alibrary%2Fmysql%3Apull&service=registry.docker.io: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
See 'docker run --help'.
sysuygm@sysuygm:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES sysuygm@sysuygm:~$ docker run -it --net host daocloud.io/library/mysql:5.7 "sh"
# mysql -h127.0.0.1 -P3306 -uroot -proot
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.20 MySQL Community Server (GPL) Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>

docker遇到超时的更多相关文章

  1. Docker从入门到掉坑(四):上手k8s避坑指南

    在之前的几篇文章中,主要还是讲解了关于简单的docker容器该如何进行管理和操作,在接下来的这篇文章开始,我们将开始进入对于k8s模块的学习 不熟悉的可以先回顾之前的章节,Docker教程系列文章将归 ...

  2. docker镜像pull不下来最终解决方法

    pull镜像wordpress下来,但是出现如下错误: # docker pull wordpress:latest Error response from daemon: Get https://r ...

  3. k8s 安装 prometheus 过程记录

    开始以为只要安装 prometheus-operator 就行了. git clone https://github.com/coreos/prometheus-operator.git cd pro ...

  4. Docker镜像拉取失败或超时的解决办法:添加国内镜像

    $ docker pull php:7.1-fpm-alpine Error response from daemon: Get https://registry-1.docker.io/v2/: n ...

  5. 阿里云 docker连接总报超时 registry.cn-hangzhou.aliyuncs.com (Client.Timeout exceeded while awaiting headers

    Error response from daemon: Get https://registry.cn-hangzhou.aliyuncs.com/v2/: net/http: request can ...

  6. docker compose启动服务超时重启记录

    一.停docker systemctl stop docker 然后ps -aux grep docker发现有些docker进程还是存在,此时强杀存在的docker进程:ps -aux|grep d ...

  7. 解决docker镜像pull超时问题

    第一步:通过dig @114.114.114.114 registry-1.docker.io找到可用IP dig @114.114.114.114 registry-1.docker.io 第二步: ...

  8. Docker命令学习

    今天更换腾讯云系统的时候发现了多了个CoreOS,据说是专门运行docker的轻量系统,顺便学习一下docker命令. 1. docker version 显示 Docker 版本信息. 2. doc ...

  9. Docker 学习之命令详解

    1. docker version docker version 显示 Docker 版本信息. 2. docker info docker info 显示 Docker 系统信息,包括镜像和容器数. ...

随机推荐

  1. UE4网络同步属性笔记

    GameMode只有服务端有,适合写游戏逻辑.PlayerController每个客户端拥有一个,并拥有主控权.GameState在服务端同步到全端. CLIENT生成的Actor对其有Authori ...

  2. wireshark 抓包过滤器使用

    目录 wireshark 抓包过滤器 一.抓包过滤器 二.显示过滤器 整理自陈鑫杰老师的wireshark教程课 wireshark 抓包过滤器 过滤器分为抓包过滤器和显示过滤器,抓包过滤器会将不满足 ...

  3. 堆,set,优先队列

    当我们需要高效的完成以下操作时: 1.插入一个元素 2.取得最小(最大)的数值,并且删除 能够完成这种操作的数据结构叫做优先队列 而能够使用二叉树,完成这种操作的数据结构叫做堆(二叉堆) 堆与优先队列 ...

  4. Python爬虫案例-获取最新的中国行政区域划分

    源网页:中国统计局标准 http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/2016/ 打开网页后可以分析出行政区域划分共分为5层 根据传入参数,生成网页 ...

  5. computed计算属性

    在computed中,可以定义一些属性,这些属性 叫做计算属性.计算属性的本质是一个方法,只不过我们在使用的时候,把他们的名称当做属性来使用,并不会吧计算属性当做方法去调用.与methods平级. / ...

  6. java的方法重写 ,多态和关键字 instanceof和final

    package cn.pen; /*final 是一个java的关键字,用于修饰局部变量.属性.方法.类,表示最终的意思. final修饰类表示最终类,无法被继承.public final class ...

  7. 一场由like引发的事故

    故事背景: 有一张用户级表,数据量在千万级别,而运营人员要查看这张表,其中有一项查询条件为根据“错误类型”(单值)查出所有包含这个类型的数据,而这个数据类型在数据库存放的方式类似于 “1,2,3,4, ...

  8. Django—视图

    索引 一.URLconf 二.视图 三.HttpReqeust对象 3.1 QueryDict对象 3.2 GET和POST属性 四.HttpResponse对象 4.1 子类JsonResponse ...

  9. Centos7源码安装mariadb

    mariadb官网:http://mirrors.opencas.cn/mariadb 安装开发工具: yum grouplist yum groupinstall "Development ...

  10. postgre 常用语法,如 group_concat用法

    1.查询postgre的表所有字段列 select table_name, column_name from information_schema.columns where table_schema ...