0

我一直按照 Google 的这些说明使用 Docker https://developers.google.com/earth-engine/python_install-datalab-local在我的本地计算机上创建和运行自定义 Datalab 容器

因为我使用的是 Windows 10 Home(而不是 Pro),所以我已经安装了 Docker Toolbox for Windows,并且正在使用 Docker 快速启动终端。

一切顺利,“docker run hello-world”命令按预期运行。

不幸的是,当我到达并运行“步骤 3 - 创建容器”中的命令时,我收到以下错误:

invalid reference format: repository name must be lowercase docker

我已经尝试了所有可以在网上找到的解决方案,但似乎没有一个适用于 Google Earth Engine 和 Docker 的这个特定问题。

我运行导致错误的行如下:

docker run -it -p "127.0.0.1:8081:8080" -v "%WORKSPACE%:/content" -e "PROJECT_ID=%GCP_PROJECT_ID%" %CONTAINER_IMAGE_NAME%

提前感谢您提供的任何建议。

更新 - 使用 linux 指令运行命令(感谢 BMitch 的建议)我观察到以下内容:

Joshua@joshuaslaptop MINGW64 ~/workspace/datalab-ee
$ docker run -it -p "127.0.0.1:8081:8080" -v "$WORKSPACE:/content" -e "PROJECT_
ID=$GCP_PROJECT_ID" $CONTAINER_IMAGE_NAME
Unable to find image 'gcr.io/earthengine-project/datalab-ee:latest' locally
latest: Pulling from earthengine-project/datalab-ee
d5c6f90da05d: Pulling fs layer
1300883d87d5: Pulling fs layer
c220aa3cfc1b: Pulling fs layer
2e9398f099dc: Pull complete
dc27a084064f: Pull complete
a9beee8825e8: Pull complete
820c4419b702: Pull complete
1e469a335c21: Pull complete
c5b0f426997a: Pull complete
9c420430911d: Pull complete
55b93740e75d: Pull complete
7529756a606c: Pull complete
32a65a2a0095: Pull complete
f1f4299b6d87: Pull complete
9b3af0c58fa7: Pull complete
25701950f728: Pull complete
02bef77e0652: Pull complete
bd0df1a3ab4b: Pull complete
0c8295055334: Pull complete
770ae3163899: Pull complete
ad91a1f8689d: Pull complete
5892df391041: Pull complete
b254f84d1e17: Pull complete
0b48033d0f70: Pull complete
363a2905e789: Pull complete
3e15c95c4f7f: Pull complete
6b68c1ba91f0: Pull complete
Digest: 
sha256:36c3348622914efc57267742114b44eb888c5093c52b11f082a8f36f3ad327d8
Status: Downloaded newer image for gcr.io/earthengine-project/datalab-ee:latest
Adding Earth Engine docs to the Datalab container...
Cloning into 'temp-repo'...
remote: Counting objects: 3844, done.
remote: Compressing objects: 100% (32/32), done.
remote: Total 3844 (delta 11), reused 25 (delta 11), pack-reused 3801
Receiving objects: 100% (3844/3844), 9.69 MiB | 1.56 MiB/s, done.
Resolving deltas: 100% (2369/2369), done.
Checking connectivity... done.
Checking out files: 100% (510/510), done.
Verifying that the /tmp directory is writable
The /tmp directory is writable
Cloning into 'docs'...
remote: Counting objects: 631, done.
remote: Compressing objects: 100% (36/36), done.
remote: Total 631 (delta 72), reused 53 (delta 53), pack-reused 542
Receiving objects: 100% (631/631), 22.09 MiB | 1.41 MiB/s, done.
Resolving deltas: 100% (323/323), done.
Checking connectivity... done.
Checking out files: 100% (55/55), done.
Already on 'master'
Your branch is up-to-date with 'origin/master'.
Starting Datalab in silent mode, for debug output, rerun with an additional '-e DATALAB_DEBUG=true' argument
Open your browser to http://localhost:8081/ to connect to Datalab.

不幸的是,当我打开浏览器并将其指向http://localhost:8081/时,我得到“无法访问此站点,localhost 拒绝连接。ERR_CONNECTION_REFUSED'

3 月 3 日:好消息 - 我使用了默认机器 IP 和 VM IP,如下所示: http://192.168.99.100:8080 现在我在数据实验室。

3 月 9 日:坏消息 - 我今晚再次尝试使用 Docker,并按照完全相同的步骤设置一切正常,直到我尝试将浏览器定向到http://192.168.99.100:8080并且我得到了 Chrome页面显示无法访问此站点和 ERR_CONNECTION_REFUSED。我已经尝试了可以​​通过 Google 找到的所有修复程序,但对于为什么现在停止工作感到非常困惑。

4

1 回答 1

0

invalid reference formatdocker 客户端尝试解析您正在运行的图像时,就会发生错误。图像是命令的第一部分,它不是 的有效参数docker run,因此可以传递一个参数,其中包含一个未引用的空格(常见于卷)。在您的情况下,引用了卷和环境变量:

docker run -it -p "127.0.0.1:8081:8080" -v "%WORKSPACE%:/content" \
  -e "PROJECT_ID=%GCP_PROJECT_ID%" %CONTAINER_IMAGE_NAME%

所以下一步是echo在前面运行上面的同一行,以确保变量正在扩展。这只会发生在 windows 命令或 power shell 中。

“docker quickstart terminal”和“192.168.99.100” ip 地址表明您正在运行 docker 工具箱,其中包括运行 virtualbox 的 Linux VM。这与基于 HyperV 的其他 Docker for Windows 安装有一些不同,包括 VM 作为不同的 IP 更加可见,并且您在快速启动终端中运行的命令使用 bash shell。

因此,您需要使用具有$CONTAINER_IMAGE_NAME而不是 windows%CONTAINER_IMAGE_NAME%语法的 Linux/Bash 命令变体。您还需要使用 VM IP 连接到您的容器。当您查看快速入门终端时,您会看到定义的一些变量,包括DOCKER_HOST,它们会导致客户端连接到 VM 中的 docker 主机。

于 2018-02-28T14:03:08.103 回答