Bash 基于docker输出中的url启动浏览器

Bash 基于docker输出中的url启动浏览器,bash,docker,shell,jupyter,Bash,Docker,Shell,Jupyter,我正在使用cmd/powershell启动docker映像,docker映像将启动Jupyter lab,该实验室的输出中有一个URL,我希望复制该URL,然后使用该URL启动默认浏览器 docker run-p 8888:8888-it“jupyter/lab” 上述命令的输出包含一些带有URL的文本: [I 18:57:25.428 LabApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runt

我正在使用cmd/powershell启动docker映像,docker映像将启动Jupyter lab,该实验室的输出中有一个URL,我希望复制该URL,然后使用该URL启动默认浏览器

docker run-p 8888:8888-it“jupyter/lab”

上述命令的输出包含一些带有URL的文本:

[I 18:57:25.428 LabApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
[I 18:57:25.542 LabApp] JupyterLab extension loaded from /usr/local/lib/python2.7/dist-packages/jupyterlab
[I 18:57:25.542 LabApp] JupyterLab application directory is /usr/local/share/jupyter/lab
[W 18:57:25.545 LabApp] JupyterLab server extension not enabled, manually loading...
[I 18:57:25.545 LabApp] JupyterLab extension loaded from /usr/local/lib/python2.7/dist-packages/jupyterlab
[I 18:57:25.546 LabApp] JupyterLab application directory is /usr/local/share/jupyter/lab
[I 18:57:25.549 LabApp] Serving notebooks from local directory: /tmp/dpcpp/release
[I 18:57:25.549 LabApp] The Jupyter Notebook is running at:
[I 18:57:25.549 LabApp] http://(811378b194e4 or 127.0.0.1):8888/?token=9c260361ba75b9a2a70ad1e9eaa12155d628700382055274
[I 18:57:25.549 LabApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 18:57:25.552 LabApp] No web browser found: could not locate runnable browser.
[C 18:57:25.552 LabApp]

    To access the notebook, open this file in a browser:
        file:///root/.local/share/jupyter/runtime/nbserver-1-open.html
    Or copy and paste one of these URLs:
        http://(811378b194e4 or 127.0.0.1):8888/?token=9c260361ba75b9a2a70ad1e9eaa12155d628700382055274
我想启动带有URL的浏览器:
http://127.0.0.1:8888/?token=9c260361ba75b9a2a70ad1e9eaa12155d628700382055274

我尝试将输出写入日志文件,然后解析日志文件中的url,并使用start cmd在浏览器中启动url,但似乎无法获取url,docker命令没有返回,它正在运行服务器

docker run -p 8888:8888 -it "jupyter/lab" > docker.log
URL=
start $URL