Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
.git/
.gitignore
.gitattributes

Dockerfile
.dockerignore

*.md
!BUILD.md
docs/
README.md
CONTRIBUTING.md


bazel-*
bazel-bin/
bazel-out/
bazel-testlogs/
bazel-workspace/


.vscode/
.idea/
*.swp
*.swo
*~
.DS_Store

.github/
.travis.yml
.circleci/

scripts/

*.tmp
*.log
*.cache
tmp/
temp/


__pycache__/
*.py[cod]
*$py.class
*.so
.Python
venv/
env/
ENV/
.venv/


node_modules/


Thumbs.db
Desktop.ini
46 changes: 46 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Build stage
FROM ubuntu:24.04 AS builder

ENV DEBIAN_FRONTEND=noninteractive

# Install dependencies
RUN apt-get update && apt-get install -y \
build-essential \
clang \
git \
curl \
python3 \
python3-pip \
nodejs \
npm \
&& rm -rf /var/lib/apt/lists/*

# Install Bazelisk
RUN npm install -g @bazel/bazelisk

# Set working directory
WORKDIR /workspace

# Copy source files
COPY . .

# Build JSIR
RUN bazelisk build //maldoca/js/ir:jsir_gen

# Runtime stage
FROM ubuntu:24.04

RUN apt-get update && apt-get install -y \
libstdc++6 \
python3 \
&& rm -rf /var/lib/apt/lists/*

# Copy binary from builder
COPY --from=builder /workspace/bazel-bin/maldoca/js/ir/jsir_gen /usr/local/bin/jsir_gen

# Copy examples
COPY --from=builder /workspace/maldoca/js/ir/conversion/tests /examples

WORKDIR /workspace

CMD ["/bin/bash"]
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,22 @@ for details.

## Getting started

### Docker (Recommended)

The easiest way to get started with JSIR is using Docker:

```shell
# Build the Docker 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
```


### Install build tools

We have only tested `clang` on Linux:
Expand Down