Search code examples
windowstensorflowdocker-toolbox

Cannot install TensorFlow on Docker Windows


When installing Tensorflow on Docker Tools on Windows, I got this error

docker: An error occurred trying to connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.23/containers/create: open //./pipe/docker_engine: The system cannot find the file specified..
See 'docker run --help'.

How to solve this issue?


Solution

  • I followed steps in this github issue.

    Maksym@MaksymPC MINGW64 ~
    $ docker ps
    An error occurred trying to connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.23/containers/json: open //./pipe/docker_engine: The system cannot find the file specified.
    
    Maksym@MaksymPC MINGW64 ~
    $ docker-machine env default
    Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.99.100:2376": tls: DialWithDialer timed out
    You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
    Be advised that this will trigger a Docker daemon restart which will stop running containers.
    
    Maksym@MaksymPC MINGW64 ~
    $ docker-machine regenerate-certs
    Regenerate TLS machine certs?  Warning: this is irreversible. (y/n): y
    Regenerating TLS certificates
    Waiting for SSH to be available...
    Detecting the provisioner...
    Copying certs to the local machine directory...
    Copying certs to the remote machine...
    Setting Docker configuration on the remote daemon...
    
    Maksym@MaksymPC MINGW64 ~
    $ docker ps
    An error occurred trying to connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.23/containers/json: open //./pipe/docker_engine: The system cannot find the file specified.
    
    Maksym@MaksymPC MINGW64 ~
    $ docker-machine env default
    export DOCKER_TLS_VERIFY="1"
    export DOCKER_HOST="tcp://192.168.99.100:2376"
    export DOCKER_CERT_PATH="C:\Users\Maksym\.docker\machine\machines\default"
    export DOCKER_MACHINE_NAME="default"
    # Run this command to configure your shell:
    # eval $("C:\Program Files\Docker Toolbox\docker-machine.exe" env default)
    
    Maksym@MaksymPC MINGW64 ~
    $ eval $("C:\Program Files\Docker Toolbox\docker-machine.exe" env default)
    
    Maksym@MaksymPC MINGW64 ~
    $ docker ps
    CONTAINER ID        IMAGE                   COMMAND                  CREATED             STATUS                         PORTS                  NAMES
    

    Then, you can run

    docker run -it -p 8888:8888 gcr.io/tensorflow/tensorflow