-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (43 loc) · 1.29 KB
/
Dockerfile
File metadata and controls
54 lines (43 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Multi-stage Dockerfile for SimpLang
FROM ubuntu:22.04 AS builder
# Avoid interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Install build dependencies
RUN apt-get update && apt-get install -y \
llvm-14-dev \
llvm-14-tools \
clang-14 \
cmake \
libboost-all-dev \
libreadline-dev \
flex \
bison \
ninja-build \
pkg-config \
git \
&& rm -rf /var/lib/apt/lists/*
# Set up LLVM alternatives
RUN update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-14 100 && \
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-14 100 && \
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-14 100
# Set working directory
WORKDIR /app
# Copy source code
COPY . .
# Build the project
RUN ./build.sh
# Runtime stage
FROM ubuntu:22.04 AS runtime
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
llvm-14-runtime \
libboost-system1.74.0 \
libreadline8 \
&& rm -rf /var/lib/apt/lists/*
# Copy built artifacts
COPY --from=builder /app/build /app/build
COPY --from=builder /app/tests /app/tests
COPY --from=builder /app/run_tests.sh /app/
WORKDIR /app
# Default command
CMD ["./run_tests.sh"]