mirror of
https://github.com/sky22333/qqbot.git
synced 2026-05-07 04:52:43 +08:00
20 lines
395 B
Docker
20 lines
395 B
Docker
FROM golang:1.26-alpine AS builder
|
|
|
|
ARG TARGETARCH
|
|
|
|
WORKDIR /app
|
|
COPY go.mod go.sum .
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -ldflags="-s -w" -trimpath -o qqbot ./cmd/qqbotd && chmod +x qqbot
|
|
|
|
FROM alpine
|
|
|
|
WORKDIR /root/
|
|
|
|
COPY --from=builder /app/qqbot .
|
|
COPY --from=builder /app/configs/config.toml .
|
|
|
|
CMD ["./qqbot", "-config", "config.toml"] |