add docker container for CAN inspection

This commit is contained in:
sigil-03 2025-09-03 17:57:04 -06:00
parent 90835f8a63
commit 806dcc7e15
4 changed files with 23 additions and 0 deletions

16
inspect/can/Dockerfile Normal file
View file

@ -0,0 +1,16 @@
FROM debian:stable-slim
RUN apt-get update && apt-get upgrade --yes
# set workdir to /usr/src/env
WORKDIR /usr/src/env
# set up base package requirements for can device
RUN apt-get install --yes can-utils iproute2
# set up python, create venv, and install cantools
RUN apt-get install --yes python3 python3-venv && python3 -m venv ./venv && . venv/bin/activate && pip install cantools
# copy init.sh to workdir
COPY init.sh ./
ENTRYPOINT ["/bin/bash", "init.sh"]

2
inspect/can/build.sh Executable file
View file

@ -0,0 +1,2 @@
#!/bin/bash
docker build --tag inspect/can .

3
inspect/can/init.sh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/bash
source venv/bin/activate
exec bash

2
inspect/can/run.sh Executable file
View file

@ -0,0 +1,2 @@
#!/bin/bash
docker run --rm -it --network=host --privileged -v ./:/usr/src/env/ext-dir inspect/can