VXCAN Network Plugin provides ability to create CAN bus/networking for Docker containers.
It is based on original code from https://gitlab.com/chgans/can4docker, with some (minor) updates and fixes.
This fork is maintained under https://github.com/wsovalle/docker-vxcan.
Plugin doesn't need any specific steps to install, although it depends on kernel modules (available out-of-the-box in Ubuntu 20.04)
$ sudo modprobe vcan
$ sudo modprobe vxcan
$ sudo modprobe can-gw
$ docker plugin install wsovalle/vxcan
This plugin fully supports docker-compose, eg.:
version: "3"
services:
app_hub:
image: ubuntu:20.04
tty: true
networks:
- canbus0
- canbus1
app_can0:
image: ubuntu:20.04
tty: true
networks: [ canbus0 ]
app_can1:
image: ubuntu:20.04
tty: true
networks: [ canbus1 ]
networks:
canbus0:
driver: wsovalle/vxcan:latest
driver_opts:
vxcan.dev: can_host
vxcan.peer: can_docker
vxcan.id: 0
canbus1:
driver: wsovalle/vxcan:latest
driver_opts:
vxcan.dev: can_host
vxcan.peer: can_docker
vxcan.id: 1
$ docker-compose up
On network level (docker network create --opts ):
vxcan.dev - CAN interface name on host, in example can_hostXvxcan.id - interface enumeration on host, in example can_host0 for canbus0 and can_host1 for canbus1vxcan.peer - CAN interface name in a container, in example can_dockerX, where X is automatic enumeration provided by dockerEndpoint level (docker network connect --driver-opts , not supported by compose):
vxcan.peer - CAN interface name in a containerContent type
Plugin
Digest
sha256:9a0346041…
Size
20.1 MB
Last updated
over 3 years ago
docker plugin install wsovalle/vxcan