Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install example dockerfile #23

Open
bencbartlett opened this issue Sep 15, 2021 · 3 comments
Open

Cannot install example dockerfile #23

bencbartlett opened this issue Sep 15, 2021 · 3 comments
Labels
🐛 bug Something isn't working 📜 documentation Improvements or additions to documentation

Comments

@bencbartlett
Copy link

I am unable to install any docker images as jupyter kernels. All attempts end with ValueError: kernelspec already exists: /Users/ben/Library/Jupyter/kernels..

Steps to reproduce:

  1. Create Dockerfile with contents from https://github.com/MrMino/dockernel/blob/master/example_dockerfile
  2. Run the following:
docker build --tag dockerneltest .
pip install dockernel
dockernel install dockerneltest

Results:

Traceback (most recent call last):
  File "/Users/ben/opt/anaconda3/bin/dockernel", line 8, in <module>
    sys.exit(main())
  File "/Users/ben/opt/anaconda3/lib/python3.7/site-packages/dockernel/__main__.py", line 6, in main
    return run(sys.argv)
  File "/Users/ben/opt/anaconda3/lib/python3.7/site-packages/dockernel/app.py", line 7, in run
    return run_subcommand(parsed_args)
  File "/Users/ben/opt/anaconda3/lib/python3.7/site-packages/dockernel/cli/main.py", line 23, in run_subcommand
    return parsed_args.func(parsed_args)
  File "/Users/ben/opt/anaconda3/lib/python3.7/site-packages/dockernel/cli/install.py", line 77, in install
    install_kernelspec(location, kernelspec)
  File "/Users/ben/opt/anaconda3/lib/python3.7/site-packages/dockernel/kernelspec.py", line 163, in install_kernelspec
    raise ValueError(f"kernelspec already exists: {kernelspec_dir}.")
ValueError: kernelspec already exists: /Users/ben/Library/Jupyter/kernels.
@MrMino
Copy link
Owner

MrMino commented Sep 17, 2021

Huh, that's weird. The kernel should install into .../kernels/{kernel_id}. May I know which version of dockernel and which OS are you using?

@akialbz
Copy link

akialbz commented Oct 5, 2021

Got the same problem. I'm using Docker version 20.10.8.
I believe this is relevant: docker/cli#2868 (comment)
When using the new buildkit the ContainerConfig is empty, so https://github.com/MrMino/dockernel/blob/master/dockernel/cli/install.py#L59 returns an empty string.
A workaround is to build the image with env DOCKER_BUILDKIT=0 docker build xxxx.
Maybe use image id or the first repo tag as kernel_id instead?

@MrMino
Copy link
Owner

MrMino commented Nov 12, 2021

@akialbz yes, that might be it. I need to dive deeper into it (and it won't happen sooner than December), but if someone wants to fix this - PRs welcome.

@MrMino MrMino added 🐛 bug Something isn't working 📜 documentation Improvements or additions to documentation labels Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 📜 documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants