Hi,
I just landed to Bluefin from Ubuntu after one year reading good things about it. So far I’m very happy with the experience and I’m just working on things that are new concepts for me.
One of them are devcontainers
. I read about them in the past but I never used them. To get acquaintance with the technology, I started to use devcontainers
in one of my toy projects.
First, I thought that it would be simplier, but the deccontainer.json
file keeps growing with new options and arguments. I’m at a point where I can run pytest
both from the VS Code testing interface and the command line (via poetry run pytest
.
However, if I try to start my main application it fails with an exception (see bellow) that makes me think of “you need to share the host’s display with the docker container”.
If, instead of devcontainers
, I create an Ubuntu container with Distrobox, install poetry and later my program, it starts normally.
I’m looking for help to get this working in VS Code and Devcontainers, since I’d like to get it working. I can always keep developing in VS Code and run my program from Distrobox, but it does not look the best way to develop.
Cheers,
Manuel
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/workspaces/chip8emulator/chip8emulator/chip8emulator.py", line 117, in main
window = Chip8Emulator(rom=rom_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/chip8emulator/chip8emulator/chip8emulator.py", line 31, in __init__
super().__init__(width=width, height=height, title="Chip-8 Emulator")
File "/workspaces/chip8emulator/.venv/lib/python3.12/site-packages/arcade/application.py", line 116, in __init__
display = pyglet.canvas.get_display()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/chip8emulator/.venv/lib/python3.12/site-packages/pyglet/canvas/__init__.py", line 94, in get_display
return Display()
^^^^^^^^^
File "/workspaces/chip8emulator/.venv/lib/python3.12/site-packages/pyglet/canvas/xlib.py", line 123, in __init__
raise NoSuchDisplayException('Cannot connect to "%s"' % name)
pyglet.canvas.xlib.NoSuchDisplayException: Cannot connect to "None"
Here is my devcontainer.json file