From f82b1be0bcb70a5ba9a1967323387bc9c04416e5 Mon Sep 17 00:00:00 2001 From: "Xinwei Xiong(cubxxw-openim)" <3293172751nss@gmail.com> Date: Wed, 30 Aug 2023 10:08:51 +0800 Subject: [PATCH] feat: set more help and port set Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> --- .dockerignore | 2 +- build/goreleaser.yaml | 22 ++----------------- build/images/openim-push/Dockerfile | 11 +++------- build/images/openim-rpc-auth/Dockerfile | 12 +--------- .../images/openim-rpc-conversation/Dockerfile | 10 +-------- build/images/openim-rpc-friend/Dockerfile | 10 +-------- build/images/openim-rpc-group/Dockerfile | 10 +-------- build/images/openim-rpc-msg/Dockerfile | 10 +-------- build/images/openim-rpc-third/Dockerfile | 11 ++-------- build/images/openim-rpc-user/Dockerfile | 10 +-------- 10 files changed, 14 insertions(+), 94 deletions(-) diff --git a/.dockerignore b/.dockerignore index 4a1f3d17f..d2e7354f5 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,7 +4,7 @@ .dockerignore # Ignore build artifacts -# _output/ +_output/ logs/ # Ignore non-essential documentation diff --git a/build/goreleaser.yaml b/build/goreleaser.yaml index 2edc2883c..63bc28a88 100644 --- a/build/goreleaser.yaml +++ b/build/goreleaser.yaml @@ -255,8 +255,8 @@ builds: - "6" - "7" - - binary: openim-rpc-user - id: openim-rpc-user + - binary: infra + id: infra main: ./tools/infra/infra.go goos: - darwin @@ -273,24 +273,6 @@ builds: - "6" - "7" - - binary: openim-rpc-user - id: openim-rpc-user - main: ./tools/ncpu/ncpu.go - goos: - - darwin - - windows - - linux - goarch: - - s390x - - mips64 - - mips64le - - amd64 - - ppc64le - - arm64 - goarm: - - "6" - - "7" - - binary: ncpu id: ncpu main: ./tools/ncpu/ncpu.go diff --git a/build/images/openim-push/Dockerfile b/build/images/openim-push/Dockerfile index 9d326ecce..2955edc4a 100644 --- a/build/images/openim-push/Dockerfile +++ b/build/images/openim-push/Dockerfile @@ -42,14 +42,9 @@ WORKDIR /openim/openim-server COPY --from=builder /openim/openim-server/_output/bin/platforms /openim/openim-server/_output/bin/platforms COPY --from=builder /openim/openim-server/config /openim/openim-server/config -EXPOSE 10170 -ENV PROMETHEUS_PORT 20170 - -CMD ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-push --port 10170 - -ENV PORT 10170 - -ENV CONFIG=/openim/openim-server/config +ENV PORT 10170 \ + PROMETHEUS_PORT 20170 \ + CONFIG=/openim/openim-server/config EXPOSE $PORT diff --git a/build/images/openim-rpc-auth/Dockerfile b/build/images/openim-rpc-auth/Dockerfile index 95b21089d..615594c3d 100644 --- a/build/images/openim-rpc-auth/Dockerfile +++ b/build/images/openim-rpc-auth/Dockerfile @@ -33,17 +33,7 @@ COPY . . RUN make clean -# RUN make build BINS=openim-rpc - -RUN make build BINS=openim-rpc -# RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-auth ./cmd/openim-rpc/openim-rpc-auth - -RUN rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-friend && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-group && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-msg && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-third && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-user && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-conversation +RUN make build BINS=openim-rpc-auth FROM ghcr.io/openim-sigs/openim-bash-image:latest diff --git a/build/images/openim-rpc-conversation/Dockerfile b/build/images/openim-rpc-conversation/Dockerfile index dd2dcb4f2..c566b5f5f 100644 --- a/build/images/openim-rpc-conversation/Dockerfile +++ b/build/images/openim-rpc-conversation/Dockerfile @@ -33,15 +33,7 @@ COPY . . RUN make clean -RUN make build BINS=openim-rpc -# RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-conversation ./cmd/openim-rpc/openim-rpc-conversation - -RUN rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-friend && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-group && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-msg && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-third && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-user && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-auth +RUN make build BINS=openim-rpc-conversation FROM ghcr.io/openim-sigs/openim-bash-image:latest diff --git a/build/images/openim-rpc-friend/Dockerfile b/build/images/openim-rpc-friend/Dockerfile index ddedfe323..8c5f1c55e 100644 --- a/build/images/openim-rpc-friend/Dockerfile +++ b/build/images/openim-rpc-friend/Dockerfile @@ -33,15 +33,7 @@ COPY . . RUN make clean -RUN make build BINS=openim-rpc -# RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-friend ./cmd/openim-rpc/openim-rpc-friend - -RUN rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-group && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-msg && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-third && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-user && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-conversation && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-auth +RUN make build BINS=openim-rpc-friend FROM ghcr.io/openim-sigs/openim-bash-image:latest diff --git a/build/images/openim-rpc-group/Dockerfile b/build/images/openim-rpc-group/Dockerfile index a8bd4cb8f..83cf3a969 100644 --- a/build/images/openim-rpc-group/Dockerfile +++ b/build/images/openim-rpc-group/Dockerfile @@ -33,15 +33,7 @@ COPY . . RUN make clean -RUN make build BINS=openim-rpc -# RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-group ./cmd/openim-rpc/openim-rpc-group - -RUN rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-friend && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-msg && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-third && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-user && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-conversation && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-auth +RUN make build BINS=openim-rpc-group FROM ghcr.io/openim-sigs/openim-bash-image:latest diff --git a/build/images/openim-rpc-msg/Dockerfile b/build/images/openim-rpc-msg/Dockerfile index f858c07aa..ed71a5657 100644 --- a/build/images/openim-rpc-msg/Dockerfile +++ b/build/images/openim-rpc-msg/Dockerfile @@ -33,15 +33,7 @@ COPY . . RUN make clean -RUN make build BINS=openim-rpc -# RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-msg ./cmd/openim-rpc/openim-rpc-msg - -RUN rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-friend && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-group && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-third && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-user && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-conversation && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-auth +RUN make build BINS=openim-rpc-msg FROM ghcr.io/openim-sigs/openim-bash-image:latest diff --git a/build/images/openim-rpc-third/Dockerfile b/build/images/openim-rpc-third/Dockerfile index 00c26e1b9..bb9456a76 100644 --- a/build/images/openim-rpc-third/Dockerfile +++ b/build/images/openim-rpc-third/Dockerfile @@ -33,15 +33,8 @@ COPY . . RUN make clean -RUN make build BINS=openim-rpc -# RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-third ./cmd/openim-rpc/openim-rpc-third - -RUN rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-friend && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-group && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-msg && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-user && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-conversation && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-auth +RUN make build BINS=openim-rpc-third + FROM ghcr.io/openim-sigs/openim-bash-image:latest diff --git a/build/images/openim-rpc-user/Dockerfile b/build/images/openim-rpc-user/Dockerfile index 340c0f8a5..6bfe06a26 100644 --- a/build/images/openim-rpc-user/Dockerfile +++ b/build/images/openim-rpc-user/Dockerfile @@ -33,15 +33,7 @@ COPY . . RUN make clean -RUN make build BINS=openim-rpc -# RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-user ./cmd/openim-rpc/openim-rpc-user - -RUN rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-friend && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-group && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-msg && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-third && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-conversation && \ - rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-auth +RUN make build BINS=openim-rpc-user FROM ghcr.io/openim-sigs/openim-bash-image:latest