如何使用Docker启动带有自定义扩展的Jupyter

zqdjd7g9  于 2022-12-18  发布在  Docker
关注(0)|答案(1)|浏览(140)

我正在尝试通过docker启动一个带有自定义扩展名(extensionTest)的jupyterlab。但是,我没有成功。有人能告诉我该怎么做吗?或者在这里举个例子?最好使用的基本docker映像是什么?
谢谢你最好的问候
我试着做这个dockerfile,但不工作:

FROM jupyter/minimal-notebook:lab-3.2.3

RUN pip install --no-cache-dir \
        astropy \
        ipytree \
        ipywidgets \
        jupyter \
        numpy \
        poliastro

RUN jupyter labextension install \
        jupyterlab-plotly@4.14.2 \
        plotlywidget@4.14.2

RUN pip install jupyterlab_widgets

COPY ./extensions/ ./extensions/

WORKDIR ./extensions/

RUN python -m pip install ./extensionTest

RUN jupyter labextension extensionTest

ENTRYPOINT start.sh jupyter lab

谢谢

gfttwv5a

gfttwv5a1#

错误代码:

ERROR: Command errored out with exit status 1:

   command: /opt/conda/bin/python /opt/conda/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmp2m0biqur

       cwd: /home/jovyan/extensions/extensionTest

  Complete output (44 lines):

  INFO:hatch_jupyter_builder.utils:Running jupyter-builder

  INFO:hatch_jupyter_builder.utils:Building with hatch_jupyter_builder.npm_builder

  INFO:hatch_jupyter_builder.utils:With kwargs: {'build_cmd': 'build:prod', 'npm': ['jlpm']}

  INFO:hatch_jupyter_builder.utils:Installing build dependencies with npm.  This may take a while...

  INFO:hatch_jupyter_builder.utils:> /tmp/pip-build-env-gj35ixm0/overlay/bin/jlpm install

  yarn install v1.21.1

  info No lockfile found.

  [1/4] Resolving packages...

  warning @jupyterlab/application > @jupyterlab/apputils > url > querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.

  warning @jupyterlab/application > @jupyterlab/ui-components > @blueprintjs/core > popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1

  warning @jupyterlab/application > @jupyterlab/ui-components > @blueprintjs/core > react-popper > popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1

  warning @jupyterlab/builder > terser-webpack-plugin > cacache > @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs

  warning @jupyterlab/builder > @jupyterlab/buildutils > crypto@1.0.1: This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.

  warning @jupyterlab/builder > @jupyterlab/buildutils > verdaccio > request@2.88.0: request has been deprecated, see https://github.com/request/request/issues/3142

  warning @jupyterlab/builder > @jupyterlab/buildutils > verdaccio > request > har-validator@5.1.5: this library is no longer supported

  warning @jupyterlab/builder > @jupyterlab/buildutils > verdaccio > request > uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

  [2/4] Fetching packages...

  warning @blueprintjs/core@3.54.0: Invalid bin entry for "upgrade-blueprint-2.0.0-rename" (in "@blueprintjs/core").

  warning @blueprintjs/core@3.54.0: Invalid bin entry for "upgrade-blueprint-3.0.0-rename" (in "@blueprintjs/core").

  error lib0@0.2.58: The engine "node" is incompatible with this module. Expected version ">=14". Got "12.4.0"

  error Found incompatible module.

  info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

  Traceback (most recent call last):

    File "/opt/conda/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>

      main()

    File "/opt/conda/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main

      json_out['return_val'] = hook(**hook_input['kwargs'])

    File "/opt/conda/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel

      return _build_backend().build_wheel(wheel_directory, config_settings,

    File "/tmp/pip-build-env-gj35ixm0/overlay/lib/python3.9/site-packages/hatchling/build.py", line 41, in build_wheel

      return os.path.basename(next(builder.build(wheel_directory, ['standard'])))

    File "/tmp/pip-build-env-gj35ixm0/overlay/lib/python3.9/site-packages/hatchling/builders/plugin/interface.py", line 136, in build

      build_hook.initialize(version, build_data)

    File "/tmp/pip-build-env-gj35ixm0/normal/lib/python3.9/site-packages/hatch_jupyter_builder/plugin.py", line 83, in initialize

      raise e

    File "/tmp/pip-build-env-gj35ixm0/normal/lib/python3.9/site-packages/hatch_jupyter_builder/plugin.py", line 78, in initialize

      build_func(self.target_name, version, **build_kwargs)

    File "/tmp/pip-build-env-gj35ixm0/normal/lib/python3.9/site-packages/hatch_jupyter_builder/utils.py", line 114, in npm_builder

      run(npm_cmd + ["install"], cwd=str(abs_path))

    File "/tmp/pip-build-env-gj35ixm0/normal/lib/python3.9/site-packages/hatch_jupyter_builder/utils.py", line 227, in run

      return subprocess.check_call(cmd, **kwargs)

    File "/opt/conda/lib/python3.9/subprocess.py", line 373, in check_call

      raise CalledProcessError(retcode, cmd)

  subprocess.CalledProcessError: Command '['/tmp/pip-build-env-gj35ixm0/overlay/bin/jlpm', 'install']' returned non-zero exit status 1.

相关问题