mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-05 03:23:49 +08:00
25 lines
456 B
Docker
25 lines
456 B
Docker
FROM golang:1.18-alpine AS builder
|
|
|
|
RUN go env -w GO111MODULE=auto \
|
|
&& go env -w CGO_ENABLED=0 \
|
|
&& go env -w GOPROXY=https://goproxy.cn,direct
|
|
|
|
WORKDIR /build
|
|
|
|
COPY ./ .
|
|
|
|
RUN set -ex \
|
|
&& cd /build \
|
|
&& go build -ldflags "-s -w -extldflags '-static'" -o cqhttp
|
|
|
|
FROM alpine:latest
|
|
|
|
RUN apk add --no-cache ffmpeg
|
|
|
|
COPY --from=builder /build/cqhttp /usr/bin/cqhttp
|
|
RUN chmod +x /usr/bin/cqhttp
|
|
|
|
WORKDIR /data
|
|
|
|
ENTRYPOINT [ "/usr/bin/cqhttp" ]
|