forked from yibaiba/hideck
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.release
More file actions
51 lines (46 loc) · 1.83 KB
/
Copy pathDockerfile.release
File metadata and controls
51 lines (46 loc) · 1.83 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
# 发版镜像:把 dist/ 里已经 UPX 打好的二进制放进 Debian 底包。
# Alpine + gcompat 跑不了 UPX 5 的 stub(Not a valid dynamic program);glibc 可以。
# 需要先有 hideck_<VERSION>_linux_amd64 和 linux_arm64,例如 hideck_v2.1.9_linux_amd64。
FROM debian:bookworm-slim
ARG VERSION=unknown
ARG BUILDTIME=unknown
ARG REVISION=unknown
ARG TARGETARCH
WORKDIR /app
LABEL org.opencontainers.image.title="HiDeck" \
org.opencontainers.image.description="Qualcomm modem management platform" \
org.opencontainers.image.source="https://github.com/yibaiba/hideck" \
org.opencontainers.image.version=${VERSION} \
org.opencontainers.image.created=${BUILDTIME} \
org.opencontainers.image.revision=${REVISION}
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
libmp3lame0 \
libopencore-amrnb0 \
libopencore-amrwb0 \
libqmi-utils \
libvo-amrwbenc0 \
psmisc \
tzdata \
wget \
&& rm -rf /var/lib/apt/lists/* \
&& test -x /usr/libexec/qmi-proxy \
&& mkdir -p /app/config /app/data /app/logs
COPY dist/hideck_${VERSION}_linux_${TARGETARCH} /usr/local/bin/hideck
RUN chmod 0755 /usr/local/bin/hideck \
&& /usr/local/bin/hideck -c /nonexistent.yaml >/tmp/hideck-boot.txt 2>&1 || true \
&& if grep -q "Not a valid dynamic program" /tmp/hideck-boot.txt; then \
cat /tmp/hideck-boot.txt >&2; \
exit 1; \
fi \
&& grep -q "配置" /tmp/hideck-boot.txt \
&& rm -f /tmp/hideck-boot.txt
EXPOSE 7575/tcp 7576/tcp 7580/udp
ENV CONFIG_PATH=/app/config/config.yaml
ENV TZ=Asia/Shanghai
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
CMD wget -q -T 3 -O /dev/null http://127.0.0.1:7575/ping || exit 1
STOPSIGNAL SIGTERM
ENTRYPOINT ["/usr/local/bin/hideck"]
CMD ["-c", "/app/config/config.yaml"]