I want to setup additional parameters to start the docker containers from the VS code plugin and I am not able to figure out where to set them. Can someone please help?
The target is to be able to use the container to access the CAN peripheral. I looked at the tutorial
but in this the docker container is required to start with additional parameters such as -net=host --cap-add=“NET_ADMIN” which I am not sure how to provide in the container?
Thanks and Regards,
So it is possible to customize the
docker run command with any flag/option you want. Using the configuration window of the extension you want to use the
However, you need to enter the extra runtime options in a certain way which isn’t immediately obvious/well documented right now. In short we use a Python backend for the extension meaning you need to enter key/value pairs for
extraparms in a way that is compatible with the Python API we use.
We use this API/library for container interaction in Python: Containers — Docker SDK for Python 6.0.1 documentation
In short for those two parameters you should have something like this according to the API:
- cap_add: ‘[“NET_ADMIN”]’
- network_mode: host
This seems to do the trick on my setup at least.