-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Add vscode dev container #414
Conversation
Hmm this is cool, I tested it on Windows and without too much hassle I got a working ubuntu image running. I'm wondering if it would be possible to automatically setup a isolated vcan bus inside the container. Do you have any experience with that? |
Out-of-scope for this PR, but on the topic of vscode, would it be nice to provide a list of recommended extensions to get new users up and running? Which we can also install in the dev container |
I wanted to submit a separate PR for a vxcan setup - but basically, as you know first hand, vcan is a host operating system feature where the networking needs to be The reason it's on the host networking is because it uses a networking interface (on Linux), I also think it's not great because that's privilaged system access (to your host network) to just to run virtual CAN. So I'd like to explore a docker container option, which keeps it all in the user space. The option I've found so far is to do it with vxcan connections and gateways. Very easy for one container as it would be just xvcan to eth bridge, but I'm imagining you want to bring up two containers, one is a vt server and the other has vt client for example. And that's a bit more tricky. Obviously this would be an example code that could be inside a tutorial for the library, or developer options. Here's a great article I found on the issue: https://www.systec-electronic.com/en/demo/blog/article/news-socketcan-docker-the-solution I'll add networking host to this PR. |
I've tested this on Apple M2 macOS 14.3, docker desktop 4.26.1, which meant I had to run It built against the gcc 11.3 from the container fine, again without examples nor a can test. |
Nice! I assume the vxcan / vcan won't work on host systems other than linux? |
Describe your changes
Add's a MS dev container for ubuntu 22.04 - gcc version 11.3.0-1ubuntu1~22.04.1
How has this been tested?
Tested on Ubuntu 23.10 desktop,
Docker version 24.0.7, build afdd53b
,vscode 1.85.2,
Dev containers version
2023-12-09, 06:02:20
Ran build as per CONTRIBUTING.md without examples.
update 2024-01-25
Added can-utils. Ran the
./scripts/setup_vcan.sh
on the host. Opened two teminal tty's inside vscode, worked sending and seeing message on candump.