无法在 Docker Windows 上安装 TensorFlow

Cannot install TensorFlow on Docker Windows

在 Windows 上的 Docker 工具上安装 Tensorflow 时,出现此错误

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'.

如何解决这个问题?

我按照 this github 问题中的步骤操作。

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

然后,您可以运行

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