Skip to content

Commit ee859a8

Browse files
authored
Merge pull request #53 from srcML/develop
Add docker file
2 parents 45b12f3 + 69a5947 commit ee859a8

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

Dockerfile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
FROM ubuntu:24.04
2+
ARG TARGETARCH
3+
4+
# 1. Install EVERYTHING (Build tools + Runtime tools)
5+
RUN apt-get update && apt-get install -y --no-install-recommends \
6+
build-essential \
7+
cmake \
8+
ninja-build \
9+
wget \
10+
ca-certificates \
11+
python3 \
12+
nano \
13+
less \
14+
git \
15+
libxml2 \
16+
libxml2-dev \
17+
&& apt-get clean \
18+
&& rm -rf /var/lib/apt/lists/*
19+
20+
# 2. Install srcML (Runtime and Dev headers together)
21+
RUN if [ "$TARGETARCH" = "amd64" ]; then \
22+
wget https://github.com/srcML/srcML/releases/download/v1.1.0/srcml_1.1.0-1_ubuntu24.04_amd64.deb \
23+
&& wget https://github.com/srcML/srcML/releases/download/v1.1.0/srcml-dev_1.1.0-1_ubuntu24.04_amd64.deb; \
24+
elif [ "$TARGETARCH" = "arm64" ]; then \
25+
wget https://github.com/srcML/srcML/releases/download/v1.1.0/srcml_1.1.0-1_ubuntu24.04_arm64.deb \
26+
&& wget https://github.com/srcML/srcML/releases/download/v1.1.0/srcml-dev_1.1.0-1_ubuntu22.04_arm64.deb; \
27+
else \
28+
echo "Unsupported arch: $TARGETARCH" && exit 1; \
29+
fi && \
30+
apt-get update && apt-get install -y ./*.deb && rm -f ./*.deb
31+
32+
# 3. Build and install srcSAX (Force standard paths so nameCollector finds it)
33+
COPY srcSAX /srcSAX
34+
WORKDIR /srcSAX
35+
RUN cmake -B build -G Ninja \
36+
-DCMAKE_INSTALL_PREFIX=/usr/local \
37+
-DCMAKE_INSTALL_LIBDIR=lib \
38+
-DCMAKE_INSTALL_INCLUDEDIR=include \
39+
&& cd build \
40+
&& ninja install
41+
42+
# 4. Build nameCollector
43+
COPY nameCollector /nameCollector
44+
WORKDIR /nameCollector
45+
RUN cmake -B build -G Ninja && cd build && ninja
46+
47+
# 5. Set default directory straight to the compiled binary
48+
WORKDIR /nameCollector/build/bin

0 commit comments

Comments
 (0)