Skip to content

Conversation

@AdityasWorks
Copy link
Contributor

Overview

This PR adds Docker support to make it easy for anyone to build and run JSIR without dealing with complex local setup. It addresses issue #29

What's Included

Dockerfile
The Dockerfile uses a two-stage build approach to keep the final image size reasonable. The builder stage image is around 4.7GB and the final image is 190MB and takes about 7-8 minutes to build.

.dockerignore
Added to optimize the build context by excluding unnecessary files, which keeps the image lean and speeds up builds.

README.md Updates
Added a Docker quick start section as the recommended way to get started, with example commands for building and running.

Quick Start

Build the image

docker build -t jsir:latest .

Run jsir_gen

docker run --rm jsir:latest jsir_gen --help

Analyze a JavaScript file

docker run --rm -v $(pwd):/workspace jsir:latest \
  jsir_gen --input_file=/workspace/yourfile.js --passes=source2ast,ast2hir

Testing

I've verified that:

  • Build completes successfully in 7-8 minutes
  • jsir_gen --help works correctly
  • /examples directory is included with test files
  • Volume mounting for local file processing works as expected
  • Output redirection to files works properly
  • Ubuntu 24.04 runtime is 190MB (Debian bookworm-slim was tested at 193MB, 3MB larger)

Notes

The compiler warnings you'll see during build are expected (they're about C++20 extensions in C++17 mode) and don't indicate any problems. No source code modifications were needed.

- Add Dockerfile with Ubuntu 24.04 builder and runtime stages
- Add .dockerignore to optimize build context
- Update README.md with Docker quick start section
@phisiart phisiart merged commit dae32a7 into google:main Oct 17, 2025
2 checks passed
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.

2 participants