Skip to content

Add Docker support (Dockerfile + docker-compose.yml)#513

Open
DVWang2001 wants to merge 1 commit into
cs01:masterfrom
DVWang2001:gdbgui-docker
Open

Add Docker support (Dockerfile + docker-compose.yml)#513
DVWang2001 wants to merge 1 commit into
cs01:masterfrom
DVWang2001:gdbgui-docker

Conversation

@DVWang2001
Copy link
Copy Markdown

Summary

Closes #474 — adds a baseline Docker environment as requested.

  • Multi-stage Dockerfile: Node 20 builds the React/Webpack frontend; Python 3.13-slim runs the gdbgui server. Keeps the final image small.
  • libstdc++ pretty-printers wired up via .gdbinit so STL containers display correctly in GDB (fixes sys.path for the python:3.13-slim layout).
  • set breakpoint pending on in .gdbinit so pending breakpoints resolve after the binary loads.
  • docker-compose.yml grants SYS_PTRACE (required by GDB) and uses seccomp:unconfined for full ptrace compatibility.
  • .dockerignore excludes node_modules and build artifacts.

Quick start

docker-compose up --build
# open http://localhost:5000

Notes

Webpack 4 + Node 17+ incompatibility: cross-env NODE_OPTIONS=--openssl-legacy-provider is rejected by Node 17+. Worked around by invoking webpack directly through node --openssl-legacy-provider ... in the Dockerfile. Upgrading to Webpack 5 would be a cleaner long-term fix but is out of scope for this PR.

Test plan

  • docker-compose up --build succeeds
  • http://localhost:5000 loads the gdbgui UI
  • Uploading and running a C++ binary hits breakpoints correctly
  • STL container variables display via pretty-printers (e.g. std::vector<int> shows {1, 2, 3} instead of a raw pointer)

Closes cs01#474 — adds a baseline Docker environment as requested.

Changes:
- Multi-stage Dockerfile: Node 20 builds the React/Webpack frontend,
  Python 3.13-slim runs the gdbgui server. Keeps the final image small.
- libstdc++ pretty-printers wired up via .gdbinit so STL containers
  display correctly in GDB (fixes sys.path for python:3.13-slim layout).
- `set breakpoint pending on` in .gdbinit so pending breakpoints resolve
  after the binary loads inside the container.
- docker-compose.yml grants SYS_PTRACE (required by GDB) and uses
  seccomp:unconfined for full ptrace compatibility.
- .dockerignore excludes node_modules and build artifacts.

Note: Webpack 4 + Node 17+ conflict — NODE_OPTIONS rejects
--openssl-legacy-provider. Worked around by invoking webpack directly
through `node --openssl-legacy-provider`. Upgrading to Webpack 5 would
be a cleaner long-term fix.

Quick start:
  docker-compose up --build
  open http://localhost:5000

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add docker build env support?

1 participant