-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.runtime
More file actions
36 lines (25 loc) · 1002 Bytes
/
Dockerfile.runtime
File metadata and controls
36 lines (25 loc) · 1002 Bytes
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
FROM golang:1.24-bookworm AS builder
WORKDIR /app
RUN rm -f /etc/apt/sources.list && rm -rf /etc/apt/sources.d
COPY sources.list /etc/apt/sources.list
RUN apt-get update && apt-get install -y --no-install-recommends \
llvm-19 llvm-19-dev make && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# use go build cache
COPY go.mod go.sum ./
RUN go env -w GOPROXY=https://goproxy.cn,direct && go mod download
COPY . .
# paralle build with make
RUN go build -tags=llvm19 -o build/compiler cmd/run/main.go && strip build/compiler
FROM debian:bookworm-slim AS runtime
WORKDIR /runtime
# timezone
ENV TZ=Asia/Shanghai
# llvm19, graphviz
RUN rm -f /etc/apt/sources.list && rm -rf /etc/apt/sources.d
COPY sources.list /etc/apt/sources.list
RUN apt-get update && apt-get install -y --no-install-recommends \
clang llvm-19-runtime graphviz && apt-get clean && rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/build/compiler /compiler/gcl
ENV DOT_DIR=/runtime/output
ENTRYPOINT ["/compiler/gcl"]