代码拉取完成,页面将自动刷新
FROM --platform=${BUILDPLATFORM} whatwewant/builder-go:v1.21-1 as builder
RUN wget -O /Country.mmdb https://github.com/doreamon-design/clash/releases/download/v2.0.8/Country.mmdb
WORKDIR /build
COPY go.mod ./
COPY go.sum ./
RUN go mod download
COPY . .
ARG TARGETOS
ARG TARGETARCH
RUN CGO_ENABLED=0 \
GOOS=${TARGETOS} \
GOARCH=${TARGETARCH} \
go build \
-trimpath \
-ldflags '-w -s -buildid=' \
-v -o /clash ./cmd/clash
FROM --platform=${BUILDPLATFORM} whatwewant/builder-node:v20-1 as builder-ui
RUN git clone https://github.com/doreamon-design/clash-dashboard -b master /build
WORKDIR /build
RUN yarn
RUN yarn build
# RUN npm i --legacy-peer-deps
# RUN NODE_OPTIONS="--openssl-legacy-provider" yarn build
FROM whatwewant/alpine:v3.17-1
ENV TZ=Asia/Shanghai
LABEL org.opencontainers.image.source="https://github.com/doreamon-design/clash"
ENV CLASH_OVERRIDE_EXTERNAL_UI_DIR=/etc/clash/ui
ENV CLASH_CONFIG_FILE=/etc/clash/config.yaml
ENV CLASH_HOME_DIR=/etc/clash
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder-ui /build/dist /etc/clash/ui
COPY --from=builder /Country.mmdb /etc/clash/
COPY --from=builder /clash /usr/bin
CMD clash
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。