File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ FROM ubuntu:24.04 AS builder
2+
3+ ARG ANTLR_VERSION=4.13.2
4+ ENV ANTLR_VERSION=$ANTLR_VERSION
5+
6+ RUN apt update && \
7+ apt install -y make libboost-graph-dev cmake default-jdk git g++ wget
8+ COPY . /Diagon
9+ RUN mkdir -p Diagon/build && \
10+ cd Diagon/build && \
11+ cmake .. -DCMAKE_BUILD_TYPE=Release && \
12+ wget -O antlr.jar https://www.antlr.org/download/antlr-$ANTLR_VERSION-complete.jar && \
13+ make -j install
14+
15+ FROM ubuntu:24.04 AS runner
16+ COPY --from=builder /usr/local/bin/diagon /usr/local/bin/diagon
17+ RUN useradd -u 1101 diagon
18+ USER 1101
19+ ENTRYPOINT [ "diagon" ]
Original file line number Diff line number Diff line change @@ -647,6 +647,20 @@ cmake .. -DCMAKE_BUILD_TYPE=Release
647647make -j
648648sudo make install
649649```
650+
651+ ## Build in Docker
652+
653+ If you have Docker installed, the repository includes a Dockerfile for convenient building:
654+ ``` sh
655+ docker build -t diagon .
656+ ```
657+
658+ Once built, the image can be invoked like the binary:
659+ ``` sh
660+ docker run diagon Math -- " f(x) = 1 + x / (1 + x)"
661+
662+ echo " f(x) = 1 + x / (1 + x)" | docker run -i diagon Math
663+ ```
650664
651665# Packaging status
652666
You can’t perform that action at this time.
0 commit comments