-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathDockerfile.slim
More file actions
53 lines (44 loc) · 1.43 KB
/
Dockerfile.slim
File metadata and controls
53 lines (44 loc) · 1.43 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
# 阶段1: 构建阶段
FROM debian:bookworm-slim AS builder
ENV TZ=Asia/Shanghai
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends \
tzdata \
git \
build-essential \
autoconf \
libreadline-dev \
libssl-dev \
wget \
unzip \
ca-certificates &&\
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
echo $TZ > /etc/timezone && \
rm -rf /var/lib/apt/lists/*
WORKDIR /build
ADD . .
RUN make
# 阶段2: 运行时镜像
FROM debian:bookworm-slim
ENV TZ=Asia/Shanghai
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libssl3 \
libgcc-s1 && \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
echo $TZ > /etc/timezone && \
rm -rf /var/lib/apt/lists/*
COPY --from=builder /build/silly /opt/
COPY --from=builder /build/lualib /opt/lualib
COPY --from=builder /build/luaclib /opt/luaclib
COPY --from=builder /build/deps/jemalloc/include/jemalloc/jemalloc.h /opt/include/jemalloc/
COPY --from=builder /build/src/*.h /opt/include/
COPY --from=builder /build/deps/lua/lua.hpp /opt/include/lua/
COPY --from=builder /build/deps/lua/luaconf.h /opt/include/lua/
COPY --from=builder /build/deps/lua/lua.h /opt/include/lua/
COPY --from=builder /build/deps/lua/lualib.h /opt/include/lua/
COPY --from=builder /build/deps/lua/lauxlib.h /opt/include/lua/
WORKDIR /app
ENTRYPOINT ["/opt/silly"]