美文网首页
mac下docker安装tensorflow

mac下docker安装tensorflow

作者: 牙齿不帅 | 来源:发表于2020-05-12 20:14 被阅读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
    

    相关文章

      网友评论

          本文标题:mac下docker安装tensorflow

          本文链接:https://www.haomeiwen.com/subject/yzxtvhtx.html