Compare commits

..

2 Commits

Author SHA1 Message Date
oleg 820f8e4aeb add docker 2026-04-09 17:02:49 +03:00
oleg 2c98d94d33 update plans 2026-04-09 16:38:37 +03:00
2 changed files with 60 additions and 0 deletions

20
Dockerfile Normal file
View File

@ -0,0 +1,20 @@
FROM manjarolinux/base:latest
RUN pacman -Syu --noconfirm && \
pacman -S --noconfirm \
clang \
cmake \
make \
git \
boost \
sqlite \
systemd-libs \
zlib && \
pacman -Scc --noconfirm
WORKDIR /app
COPY . .
RUN cmake -B build -S . && cmake --build build -j$(nproc)
ENTRYPOINT ["./build/canscope"]

View File

@ -29,6 +29,23 @@ cmake -B build -S . && cmake --build build -j$(nproc)
Binary: `build/canscope` Binary: `build/canscope`
### Docker
```bash
docker build -t canscope .
```
```bash
# TUI mode -- requires terminal and CAN interface access
docker run -it --network=host canscope -e "candump can0" -j1939 /app/thirdparty/j1939da_2018.xlsx
# Headless mode
docker run --network=host canscope -hl -e "candump can0" -j1939 /app/thirdparty/j1939da_2018.xlsx
# Read from stdin
candump can0 | docker run -i canscope -j1939 /app/thirdparty/j1939da_2018.xlsx -hl
```
## Usage ## Usage
```bash ```bash
@ -41,6 +58,21 @@ Binary: `build/canscope`
# Headless -- JSON to file # Headless -- JSON to file
./build/canscope -hl -e "candump can0" -j1939 thirdparty/j1939da_2018.xlsx -of output.json ./build/canscope -hl -e "candump can0" -j1939 thirdparty/j1939da_2018.xlsx -of output.json
# Read from stdin (pipe)
candump can0 | ./build/canscope -j1939 thirdparty/j1939da_2018.xlsx
# Headless with stdin
candump can0 | ./build/canscope -hl -j1939 thirdparty/j1939da_2018.xlsx
# Docker -- TUI with CAN interface access
docker run -it --network=host canscope -e "candump can0" -j1939 /app/thirdparty/j1939da_2018.xlsx
# Docker -- headless
docker run --network=host canscope -hl -e "candump can0" -j1939 /app/thirdparty/j1939da_2018.xlsx
# Docker -- read from stdin
candump can0 | docker run -i canscope -hl -j1939 /app/thirdparty/j1939da_2018.xlsx
# Record to SQLite database # Record to SQLite database
./build/canscope -rec -db recording.db -e "candump can0" -j1939 thirdparty/j1939da_2018.xlsx ./build/canscope -rec -db recording.db -e "candump can0" -j1939 thirdparty/j1939da_2018.xlsx
@ -48,6 +80,8 @@ Binary: `build/canscope`
./build/canscope -rec -db recording.db -tui -e "candump can0" -j1939 thirdparty/j1939da_2018.xlsx ./build/canscope -rec -db recording.db -tui -e "candump can0" -j1939 thirdparty/j1939da_2018.xlsx
``` ```
> **Note:** J1939 decoding has only been tested with the Digital Annex 2018 edition. Other editions may work but are not guaranteed.
### CLI flags ### CLI flags
| Flag | Long form | Description | | Flag | Long form | Description |
@ -97,3 +131,9 @@ candump / other CAN source
- Factory functions via `extern` declarations instead of header includes - Factory functions via `extern` declarations instead of header includes
- `std::jthread` / `std::stop_token` for async task management - `std::jthread` / `std::stop_token` for async task management
- SIGINT gracefully stops all background tasks - SIGINT gracefully stops all background tasks
## Roadmap
- **Cross-platform support** -- Windows and macOS in addition to Linux
- ~~**Docker deployment** -- pre-built image for quick setup without manual compilation~~
- **CANopen protocol support** -- CANopen decoding alongside J1939