From 17784cebb511e1a8a7d3613b4ad659202a7328c6 Mon Sep 17 00:00:00 2001 From: "Xinwei Xiong(cubxxw-openim)" <3293172751nss@gmail.com> Date: Mon, 7 Aug 2023 12:28:46 +0800 Subject: [PATCH] fix: fix image Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> --- Dockerfile | 2 +- build/docker/api-admin/Dockerfile | 11 +++++++---- build/docker/api-chat/Dockerfile | 11 +++++++---- build/docker/rpc-admin/Dockerfile | 11 +++++++---- build/docker/rpc-chat/Dockerfile | 11 +++++++---- 5 files changed, 29 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index f6d997b5b..69469998f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,7 +40,7 @@ FROM ghcr.io/openim-sigs/openim-bash-image:latest WORKDIR ${CHAT_WORKDIR} -COPY --from=builder ${SERVER_WORKDIR}/_output/bin/platforms /openim/openim-chat/_output/bin/platforms +COPY --from=builder ${CHAT_WORKDIR}/_output/bin/platforms /openim/openim-chat/_output/bin/platforms COPY --from=builder ${OPENIM_CHAT_CMDDIR} /openim/openim-chat/scripts COPY --from=builder ${OPENIM_CHAT_CONFIG_NAME} /openim/openim-chat/config/config.yaml diff --git a/build/docker/api-admin/Dockerfile b/build/docker/api-admin/Dockerfile index 002734a6f..9056e16b6 100644 --- a/build/docker/api-admin/Dockerfile +++ b/build/docker/api-admin/Dockerfile @@ -34,16 +34,19 @@ RUN go mod download COPY . . -RUN CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build -o /openim/openim-chat/bin/admin-api ./cmd/api/admin-api +RUN make clean +RUN make build BINS=api + +RUN rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/chat-api FROM ghcr.io/openim-sigs/openim-bash-image:latest WORKDIR ${CHAT_WORKDIR} -COPY --from=builder ${OPENIM_CHAT_BINDIR}/admin-api /openim/openim-chat/bin/admin-api +COPY --from=builder ${OPENIM_CHAT_BINDIR}/platforms /openim/openim-chat/_output/bin/platforms COPY --from=builder ${OPENIM_CHAT_CONFIG_NAME} /openim/openim-chat/config/config.yaml -env PORT=10009 +ENV PORT=10009 EXPOSE ${PORT} -CMD ["bash","-c","${OPENIM_CHAT_BINDIR}/admin-api --port ${PORT} --config_folder_path ${OPENIM_CHAT_CONFIG_NAME}"] +CMD ["bash","-c","${OPENIM_CHAT_BINDIR}/platforms/${OS}/${ARCH}/admin-api --port ${PORT} --config_folder_path ${OPENIM_CHAT_CONFIG_NAME}"] diff --git a/build/docker/api-chat/Dockerfile b/build/docker/api-chat/Dockerfile index 6547e3657..fd0ac1b00 100644 --- a/build/docker/api-chat/Dockerfile +++ b/build/docker/api-chat/Dockerfile @@ -31,16 +31,19 @@ RUN go mod download COPY . . -RUN CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build -o /openim/openim-chat/bin/chat-api ./cmd/api/chat-api +RUN make clean +RUN make build BINS=api + +RUN rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/admin-api FROM ghcr.io/openim-sigs/openim-bash-image:latest WORKDIR ${CHAT_WORKDIR} -COPY --from=builder ${OPENIM_CHAT_BINDIR}/chat-api /openim/openim-chat/bin/chat-api +COPY --from=builder ${OPENIM_CHAT_BINDIR}/platforms /openim/openim-chat/_output/bin/platforms COPY --from=builder ${OPENIM_CHAT_CONFIG_NAME} /openim/openim-chat/config/config.yaml -env PORT=10008 +ENV PORT=10008 EXPOSE ${PORT} -CMD ["sh", "-c","${OPENIM_CHAT_BINDIR}/chat-api --port ${PORT} --config_folder_path ${OPENIM_CHAT_CONFIG_NAME}"] +CMD ["bash", "-c","${OPENIM_CHAT_BINDIR}/platforms/${OS}/${ARCH}/chat-api --port ${PORT} --config_folder_path ${OPENIM_CHAT_CONFIG_NAME}"] diff --git a/build/docker/rpc-admin/Dockerfile b/build/docker/rpc-admin/Dockerfile index 2e09fb33f..035ac2a43 100644 --- a/build/docker/rpc-admin/Dockerfile +++ b/build/docker/rpc-admin/Dockerfile @@ -31,16 +31,19 @@ RUN go mod download COPY . . -RUN CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build -o /openim/openim-chat/bin/admin-rpc ./cmd/rpc/admin-rpc +RUN make clean +RUN make build BINS=rpc + +RUN rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/chat-rpc FROM ghcr.io/openim-sigs/openim-bash-image:latest WORKDIR ${CHAT_WORKDIR} -COPY --from=builder ${OPENIM_CHAT_BINDIR}/admin-rpc /openim/openim-chat/bin/admin-rpc +COPY --from=builder ${OPENIM_CHAT_BINDIR}/platforms /openim/openim-chat/_output/bin/platforms COPY --from=builder ${OPENIM_CHAT_CONFIG_NAME} /openim/openim-chat/config/config.yaml -env PORT=30200 +ENV PORT=30200 EXPOSE ${PORT} -CMD ["sh", "-c", "${OPENIM_CHAT_BINDIR}/admin-rpc --port ${PORT} --config_folder_path ${OPENIM_CHAT_CONFIG_NAME}"] +CMD ["bash", "-c", "${OPENIM_CHAT_BINDIR}/platforms/${OS}/${ARCH}/admin-rpc --port ${PORT} --config_folder_path ${OPENIM_CHAT_CONFIG_NAME}"] diff --git a/build/docker/rpc-chat/Dockerfile b/build/docker/rpc-chat/Dockerfile index 651a438ca..c3d7e88b7 100644 --- a/build/docker/rpc-chat/Dockerfile +++ b/build/docker/rpc-chat/Dockerfile @@ -31,16 +31,19 @@ RUN go mod download COPY . . -RUN CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build -o /openim/openim-chat/bin/chat-rpc ./cmd/rpc/chat +RUN make clean +RUN make build BINS=rpc + +RUN rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/admin-rpc FROM ghcr.io/openim-sigs/openim-bash-image:latest WORKDIR ${CHAT_WORKDIR} -COPY --from=builder ${OPENIM_CHAT_BINDIR}/chat-rpc /openim/openim-chat/bin/chat-rpc +COPY --from=builder ${OPENIM_CHAT_BINDIR}/platforms /openim/openim-chat/_output/bin/platforms COPY --from=builder ${OPENIM_CHAT_CONFIG_NAME} /openim/openim-chat/config/config.yaml -env PORT=30300 +ENV PORT=30300 EXPOSE ${PORT} -CMD ["sh", "-c","${OPENIM_CHAT_BINDIR}/chat-rpc --port ${PORT} --config_folder_path ${OPENIM_CHAT_CONFIG_NAME}"] \ No newline at end of file +CMD ["bash", "-c","${OPENIM_CHAT_BINDIR}/platforms/${OS}/${ARCH}/chat-rpc --port ${PORT} --config_folder_path ${OPENIM_CHAT_CONFIG_NAME}"] \ No newline at end of file