无法使用 Docker 获取本地主机 IP
Unable to get localhost IP using Docker
我正在尝试使用 scrapy-splash,所以我在我的 Windows 7 上安装了 Docker Toolsbox,之后我按照这些步骤操作:
# Pull the image:
docker pull scrapinghub/splash
# Start the container:
docker run -p 8050:8050 -p 5023:5023 scrapinghub/splash
当我 运行 最后一行时,我收到了这条消息:
$ docker run -p 8050:8050 -p 5023:5023 scrapinghub/splash
2020-02-27 09:00:16+0000 [-] Log opened.
2020-02-27 09:00:17.520688 [-] Xvfb is started: ['Xvfb', ':1917600420', '-screen
', '0', '1024x768x24', '-nolisten', 'tcp']
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-splash'
2020-02-27 09:00:32.662453 [-] Splash version: 3.4.1
2020-02-27 09:00:43.522556 [-] Qt 5.13.1, PyQt 5.13.1, WebKit 602.1, Chromium 73
.0.3683.105, sip 4.19.19, Twisted 19.7.0, Lua 5.2
2020-02-27 09:00:43.523779 [-] Python 3.6.9 (default, Nov 7 2019, 10:44:02) [GC
C 8.3.0]
2020-02-27 09:00:43.525499 [-] Open files limit: 1048576
2020-02-27 09:00:43.526626 [-] Can't bump open files limit
2020-02-27 09:00:44.041465 [-] proxy profiles support is enabled, proxy profiles
path: /etc/splash/proxy-profiles
2020-02-27 09:00:44.043590 [-] memory cache: enabled, private mode: enabled, js
cross-domain access: disabled
2020-02-27 09:00:49.395125 [-] verbosity=1, slots=20, argument_cache_max_entries
=500, max-timeout=90.0
2020-02-27 09:00:49.397111 [-] Web UI: enabled, Lua: enabled (sandbox: enabled),
Webkit: enabled, Chromium: enabled
2020-02-27 09:00:49.399925 [-] Site starting on 8050
2020-02-27 09:00:49.401080 [-] Starting factory <twisted.web.server.Site object
at 0x7f82942b71d0>
2020-02-27 09:00:49.404033 [-] Server listening on http://0.0.0.0:8050
为什么我无法获得本地主机 IP 来使用 Splash?
编辑:
## .
## ## ## ==
## ## ## ## ## ===
/"""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\_______/
docker is configured to use the default machine with IP 192.168.99.102
For help getting started, check out the docs at https://docs.docker.com
我刚刚复制了 docker 从第一个屏幕显示的 IP,并将其粘贴到我的浏览器中,监听端口为:192.168.99.102:8050
2020-02-27 09:00:49.404033 [-] Server listening on http://0.0.0.0:8050
0.0.0.0表示所有接口。
只需导航到 http://localhost:8050
我正在尝试使用 scrapy-splash,所以我在我的 Windows 7 上安装了 Docker Toolsbox,之后我按照这些步骤操作:
# Pull the image:
docker pull scrapinghub/splash
# Start the container:
docker run -p 8050:8050 -p 5023:5023 scrapinghub/splash
当我 运行 最后一行时,我收到了这条消息:
$ docker run -p 8050:8050 -p 5023:5023 scrapinghub/splash
2020-02-27 09:00:16+0000 [-] Log opened.
2020-02-27 09:00:17.520688 [-] Xvfb is started: ['Xvfb', ':1917600420', '-screen
', '0', '1024x768x24', '-nolisten', 'tcp']
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-splash'
2020-02-27 09:00:32.662453 [-] Splash version: 3.4.1
2020-02-27 09:00:43.522556 [-] Qt 5.13.1, PyQt 5.13.1, WebKit 602.1, Chromium 73
.0.3683.105, sip 4.19.19, Twisted 19.7.0, Lua 5.2
2020-02-27 09:00:43.523779 [-] Python 3.6.9 (default, Nov 7 2019, 10:44:02) [GC
C 8.3.0]
2020-02-27 09:00:43.525499 [-] Open files limit: 1048576
2020-02-27 09:00:43.526626 [-] Can't bump open files limit
2020-02-27 09:00:44.041465 [-] proxy profiles support is enabled, proxy profiles
path: /etc/splash/proxy-profiles
2020-02-27 09:00:44.043590 [-] memory cache: enabled, private mode: enabled, js
cross-domain access: disabled
2020-02-27 09:00:49.395125 [-] verbosity=1, slots=20, argument_cache_max_entries
=500, max-timeout=90.0
2020-02-27 09:00:49.397111 [-] Web UI: enabled, Lua: enabled (sandbox: enabled),
Webkit: enabled, Chromium: enabled
2020-02-27 09:00:49.399925 [-] Site starting on 8050
2020-02-27 09:00:49.401080 [-] Starting factory <twisted.web.server.Site object
at 0x7f82942b71d0>
2020-02-27 09:00:49.404033 [-] Server listening on http://0.0.0.0:8050
为什么我无法获得本地主机 IP 来使用 Splash?
编辑:
## .
## ## ## ==
## ## ## ## ## ===
/"""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\_______/
docker is configured to use the default machine with IP 192.168.99.102
For help getting started, check out the docs at https://docs.docker.com
我刚刚复制了 docker 从第一个屏幕显示的 IP,并将其粘贴到我的浏览器中,监听端口为:192.168.99.102:8050
2020-02-27 09:00:49.404033 [-] Server listening on http://0.0.0.0:8050
0.0.0.0表示所有接口。
只需导航到 http://localhost:8050