-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (51 loc) · 1.71 KB
/
Dockerfile
File metadata and controls
61 lines (51 loc) · 1.71 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
55
56
57
58
59
60
61
ARG MY_DEBIAN_VERSION=trixie
FROM quay.io/lib/debian:${MY_DEBIAN_VERSION} AS pttbbs-builder
COPY confs /tmp/confs
COPY patches /tmp/patches
COPY build_ptt.sh /tmp/build_ptt.sh
ENV DEBIAN_VERSION=${MY_DEBIAN_VERSION}
ENV DEBIAN_FRONTEND=noninteractive
RUN set -x \
&& groupadd --gid 99 bbs \
&& useradd -m -g bbs -s /bin/bash --uid 9999 bbs \
&& rm /etc/localtime \
&& ln -rsv /usr/share/zoneinfo/Asia/Taipei /etc/localtime
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
bmake \
gcc \
g++ \
libc6-dev \
ca-certificates \
python3 \
python-is-python3 \
"libevent-2.1$(if [ $DEBIAN_VERSION = trixie ];then echo "-7t64";fi)" \
libevent-dev \
pkg-config \
git \
ccache
USER bbs
WORKDIR /home/bbs
RUN bash /tmp/build_ptt.sh
############ stage 2
FROM quay.io/lib/debian:${MY_DEBIAN_VERSION}-slim AS stage-fileselector
COPY --from=pttbbs-builder /home/bbs /home/bbs
RUN rm -rvf /home/bbs/pttbbs
RUN rm -rvf /home/bbs/.cache
############ stage 3
FROM quay.io/lib/debian:${MY_DEBIAN_VERSION}-slim
COPY --from=stage-fileselector /home/bbs /home/bbs
ENV DEBIAN_VERSION=${MY_DEBIAN_VERSION}
RUN set -x \
&& groupadd --gid 99 bbs \
&& useradd -m -g bbs -s /bin/bash --uid 9999 bbs \
&& rm /etc/localtime \
&& ln -rsv /usr/share/zoneinfo/Asia/Taipei /etc/localtime \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
"libevent-2.1$(if [ $DEBIAN_VERSION = trixie ];then echo "-7t64";fi)" \
&& apt-get clean \
&& rm -rvf /var/cache/apt/archives /var/lib/apt/lists/*
USER bbs
CMD ["sh","-c","/home/bbs/bin/shmctl init && /home/bbs/bin/logind -D"]
EXPOSE 8888