diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 9a6e416..2916189 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -15,7 +15,6 @@ builds: - -s -w -X sub2sing-box/constant.Version={{ .Version }} flags: - -trimpath - no_unique_dist_dir: true archives: - format: tar.gz format_overrides: diff --git a/.woodpecker/docker-nightly.yml b/.woodpecker/docker-nightly.yml index afa28f9..5c39913 100644 --- a/.woodpecker/docker-nightly.yml +++ b/.woodpecker/docker-nightly.yml @@ -6,7 +6,7 @@ steps: - name: build image: woodpeckerci/plugin-docker-buildx settings: - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64,linux/arm/v7 repo: nite07/sub2sing-box tag: nightly username: nite07 diff --git a/.woodpecker/docker.yml b/.woodpecker/docker.yml index 9317aa6..0343bd0 100644 --- a/.woodpecker/docker.yml +++ b/.woodpecker/docker.yml @@ -1,13 +1,13 @@ when: event: tag - + steps: - name: build image: woodpeckerci/plugin-docker-buildx settings: - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64,linux/arm/v7 repo: nite07/sub2sing-box - tag: ${CI_COMMIT_TAG} + auto_tag: true username: nite07 password: from_secret: docker_password diff --git a/Dockerfile b/Dockerfile index b03858d..6401c4e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,25 +2,17 @@ FROM golang:1.21 as builder LABEL authors="nite07" WORKDIR /app - COPY . . RUN go mod download - ARG version - -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w -X sub2sing-box/constant.Version=${version}" -o sub2sing-box main.go - +RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w -X sub2sing-box/constant.Version=${version}" -o sub2sing-box . WORKDIR /app FROM alpine:latest - COPY --from=builder /app/sub2sing-box /app/sub2sing-box COPY --from=builder /app/templates /app/templates-origin COPY --from=builder /app/entrypoint.sh /app/entrypoint.sh - RUN chmod +x /app/entrypoint.sh - VOLUME [ "/app/templates" ] EXPOSE 8080 - ENTRYPOINT ["/app/entrypoint.sh"]