From 8fb9afb9554493f19170b43d80e0e951029021fe Mon Sep 17 00:00:00 2001 From: Your Name <10572974+eraiza0816@users.noreply.github.com> Date: Tue, 14 Jul 2026 01:52:48 +0900 Subject: [PATCH] feat: add Dockerfile for development environment - Debian 13 (trixie) based with sdcc 4.5.0 from apt - Includes gcc, make, xxd, python3, libjson-c-dev, golang-go - Add .dockerignore to exclude build artifacts - Add Docker usage section to README (collapsible) --- .dockerignore | 19 +++++++++++++++++++ Dockerfile | 19 +++++++++++++++++++ README.md | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f3bb7ae --- /dev/null +++ b/.dockerignore @@ -0,0 +1,19 @@ +.git/ +.gitignore +.gitattributes +.github/ +output/ +installer/output/ +*.bin +html_data.c +html_data.h +*.o +*.rel +*.lst +*.sym +*.asm +*.ihx +*.img +*.map +*.mem +*.lk diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6ed31e0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM debian:13-slim + +RUN apt-get update && apt-get install -y \ + make \ + gcc \ + sdcc \ + xxd \ + python3 \ + libjson-c-dev \ + golang-go \ + git \ + && rm -rf /var/lib/apt/lists/* + +# git safe.directory for mounted repos (Makefile uses git describe) +RUN git config --global --add safe.directory /workspace + +WORKDIR /workspace + +CMD ["bash"] diff --git a/README.md b/README.md index a1d11bf..9044a0c 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,42 @@ still has an older version of sdcc, but you will need sdcc version 4.5 for the c sudo apt install make gcc sdcc xxd python-is-python3 libjson-c-dev ``` +
+If using Docker (click to expand) + +A Dockerfile is provided for a reproducible build environment: + +``` +docker build -t rtlplayground-dev . +``` + +Build the firmware (replace MACHINE with your target, e.g. `DEFAULT_8C_1SFP`): + +``` +docker run --rm -v $(pwd):/workspace rtlplayground-dev make MACHINE=DEFAULT_8C_1SFP +``` + +The resulting `.bin` file appears in `output/` on your host. + +Build host tools only: + +``` +docker run --rm -v $(pwd):/workspace rtlplayground-dev make -C tools +``` + +Run the web-interface simulator locally: + +``` +docker run --rm -p 8080:8080 -v $(pwd):/workspace rtlplayground-dev \ + tools/output/httpd_sim /workspace/html +``` + +Edit `machine.h` or `config.txt` on your host, then re-run `make` — the +source directory is mounted into the container, so changes take effect +immediately. To build for a different machine, pass `MACHINE=...`. + +
+ ## (1) Compiling for direct chip flashing AND upgrading an existing RTLPlayground running device Edit machine.h with an editor like vi or nano. Select the correct machine the firmware should build for.