【Docker】修改镜像源
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[root@xxf ~]# docker -v Docker version 19.03.5, build 633a0ea [root@xxf ~]# [root@xxf ~]# docker search mysql -s 100 Flag --stars has been deprecated, use --filter=stars=3 instead NAME DESCRIPTION STARS OFFICIAL AUTOMATED mysql MySQL is a widely used, open-source relation… 9079 [OK] mariadb MariaDB is a community-developed fork of MyS… 3210 [OK] mysql/mysql-server Optimized MySQL Server Docker images. Create… 673 [OK] [root@xxf ~]# [root@xxf ~]# docker pull mysql Using default tag: latest Error response from daemon: Get https://registry-1.docker.io/v2/: x509: certificate is valid for pss-cep-authtoken.asurionmobile.com, www.pss-cep-authtoken.asurionmobile.com, pss-cep-campaignrest.asurionmobile.com, pss-cep-campauto.asurionmobile.com, pss-cep-campaignweb.asurionmobile.com, pss-cep-criterialoader.asurionmobile.com, pss-cep-csvloader.asurionmobile.com, pss-cep-datalookupservice.asurionmobile.com, pss-cep-dbmigrationapi.asurionmobile.com, pss-cep-deviceregister.asurionmobile.com, pss-cep-dynamicdataapi.asurionmobile.com, pss-cep-enrollmentfeedprocesor.asurionmobile.com, pss-cep-eventforapi.asurionmobile.com, pss-cep-gatewayapi.asurionmobile.com, pss-cep-history-api.asurionmobile.com, pss-cep-jobreader.asurionmobile.com, pss-cep-notificationapi.asurionmobile.com, pss-cep-preferencesapi.asurionmobile.com, pss-cep-refloader.asurionmobile.com, pss-cep-servertemplateprocessor.asurionmobile.com, pss-cep-ssloader.asurionmobile.com, pss-cep-schedulerapi.asurionmobile.com, pss-cep-smsgatewayapi.asurionmobile.com, pss-dis-supportviewapi.asurionmobile.com, not registry-1.docker.io [root@xxf ~]# |
Docker默认的镜像源是国外的地址,需要翻墙才行,导致我们在镜像库中拉取时无响应。
解决办法,修改镜像源,我们改为阿里的镜像源
|
1 2 3 4 5 |
[root@xxf ~]# vi /etc/docker/daemon.json #### 通过vi编辑器,修改或添加如下内容 { "registry-mirrors": ["https://md4nbj2f.mirror.aliyuncs.com"] } |
重启docker
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
[root@xxf ~]# systemctl restart docker [root@xxf ~]# [root@xxf ~]# [root@xxf ~]# [root@xxf ~]# [root@xxf ~]# docker pull mysql Using default tag: latest latest: Pulling from library/mysql 804555ee0376: Pull complete c53bab458734: Pull complete ca9d72777f90: Pull complete 2d7aad6cb96e: Pull complete 8d6ca35c7908: Pull complete 6ddae009e760: Pull complete 327ae67bbe7b: Pull complete e039ec97e847: Pull complete fbda57f041c1: Pull complete f70ca9049b77: Pull complete 30ecde006e59: Pull complete 7def2a4ede73: Pull complete Digest: sha256:f1df505c4c6e8eae599a0482e3bde3e761cd700c00cbc371a8161648a26817c0 Status: Downloaded newer image for mysql:latest docker.io/library/mysql:latest [root@xxf ~]# |