user1984778
user1984778

Reputation: 325

Access non-IP interface in docker container

is it possible to access a non-IP network interface inside a docker-container? All docker (bridge etc.) networks seem to run with IP-addressing, but I want to access a CAN (PF_CAN = SocketCAN) interface can0.

Thank you.

Upvotes: 1

Views: 1444

Answers (1)

user1984778
user1984778

Reputation: 325

Thank you @Salem: I didn't know the --net=host parameter - It works! So in summary:

Run

$ docker run --net=host ...`

or use Docker-Compose:

$ cat docker-compose.yml
version: '3'
services:
  foo:
    network_mode: host
    ...

Upvotes: 1

Related Questions