Files
hideck/Dockerfile.release
T

52 lines
1.8 KiB
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 发版镜像:把 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"]