mac下docker安装tensorflow

2020-05-12  本文已影响0人  牙齿不帅

1.安装docker,没啥说的去官网,下载安装注册登陆即可,具体的忽略了。
2.配置docker国内镜像。

//首先修改镜像源地址,用户目录./docker/daemon.json
{ 
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"] 
}
//登录网易docker库,需要注册网易docker账号
# docker login --username=xxx http://hub-mirror.c.163.com
Password: 
//安装tensorflow
# docker pull tensorflow/tensorflow

错误:Get https://registry-1.docker.io/v2/: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
执行dig命令解决:

# dig @114.114.114.114 registry-1.docker.io
; <<>> DiG 9.10.6 <<>> @114.114.114.114 registry-1.docker.io
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13563
;; flags: qr rd ra; QUERY: 1, ANSWER: 8, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;registry-1.docker.io.      IN  A

;; ANSWER SECTION:
registry-1.docker.io.   35  IN  A   100.24.246.89
registry-1.docker.io.   35  IN  A   3.221.133.86
registry-1.docker.io.   35  IN  A   3.210.179.11
registry-1.docker.io.   35  IN  A   3.224.75.242
registry-1.docker.io.   35  IN  A   54.210.105.17
registry-1.docker.io.   35  IN  A   3.209.173.81
registry-1.docker.io.   35  IN  A   3.224.11.4
registry-1.docker.io.   35  IN  A   34.202.247.184

;; Query time: 22 msec
;; SERVER: 114.114.114.114#53(114.114.114.114)
;; WHEN: Tue Apr 14 14:37:14 CST 2020
;; MSG SIZE  rcvd: 177

修改/etc/host文件添加

100.24.246.89  registry-1.docker.io

登录tensorflow镜像

# docker run -it tensorflow/tensorflow
上一篇 下一篇

猜你喜欢

热点阅读