Files
xxxigcc/docker/Dockerfile.Daemon
Wang Defa 612ec7b521
Some checks failed
Build and Release / build-and-test (alpine) (push) Failing after 53s
Build and Release / build-and-test (ubuntu) (push) Failing after 8m7s
Build and Release / docker-images (push) Has been skipped
Build and Release / release (push) Has been skipped
首次提交
2025-12-02 11:57:14 +08:00

34 lines
910 B
Docker

FROM alpine:3.21
ARG TARGETARCH
ARG TARGZ_FILE_AMD64
ARG TARGZ_FILE_ARM64
RUN apk update && apk add --no-cache wget
COPY ./app /app
RUN if [ "$TARGETARCH" = "amd64" ]; then \
ARCH_FILE="$TARGZ_FILE_AMD64"; \
elif [ "$TARGETARCH" = "arm64" ]; then \
ARCH_FILE="$TARGZ_FILE_ARM64"; \
else \
echo "不支持的架构: $TARGETARCH" && exit 1; \
fi && \
echo "TARGETARCH: $TARGETARCH" && \
echo "使用文件: $ARCH_FILE" && \
ls -la /app/ && \
tar -xzf "/app/${ARCH_FILE}" -C /app --strip-components=1 && \
ls -la /app/ && \
rm -rf /app/*.tar.gz /app/config.json /app/config_cc.json /app/index.html /app/xxxigServer && \
addgroup -S xxxig && \
adduser -S -G xxxig xxxig && \
mkdir -p /app/data && \
chown -R xxxig:xxxig /app && \
chmod +x /app/xxxigDaemon /app/xxxigMiner
USER xxxig
WORKDIR /app
ENTRYPOINT ["/app/xxxigDaemon"]