From 69e3701940c052031ccbb4a638d6c9b6f36e5692 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Mon, 22 Apr 2024 20:20:26 +0800 Subject: [PATCH 01/41] refactor dockerFile --- Dockerfile | 69 ++++++++++++++++++++++++------------------------------ 1 file changed, 30 insertions(+), 39 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2ecf60a70..456dc2ba2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,48 +1,39 @@ -# Copyright © 2023 OpenIM open source community. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -ARG GOARCH -ARG GOOS - -# Use golang as the builder stage -FROM golang:1.21 AS builder - -ARG GO111MODULE=on -ARG GOPROXY=https://goproxy.io,direct - -WORKDIR /openim/openim-chat - -ENV GO111MODULE=$GO111MODULE -ENV GOPROXY=$GOPROXY +# Use Go 1.21 as the base image for building the application +FROM golang:1.21 as builder + +# Set the working directory inside the container +WORKDIR /openim-chat + +# Set the Go proxy to improve dependency resolution speed +ENV GOPROXY=https://goproxy.cn,direct COPY go.mod go.sum ./ RUN go mod download +# Copy all files from the current directory into the container +COPY . . + + +RUN go install github.com/magefile/mage@latest + +RUN mage build + +# Use Alpine Linux as the final base image due to its small size and included utilities +FROM alpine:latest + +# Install necessary packages, such as bash, to ensure compatibility and functionality +RUN apk add --no-cache bash -# Copy all files to the container -ADD . . +# Copy the compiled binaries and mage from the builder image to the final image +COPY --from=builder /openim-chat/_output /openim-chat/_output +COPY --from=builder /go/bin/mage /usr/local/bin/mage -RUN make clean -RUN make build +# Set the working directory to /openim-chat within the container +WORKDIR /openim-chat -# Build the runtime stage -FROM ghcr.io/openim-sigs/openim-ubuntu-image:latest +# Set up volume mounts for the configuration directory and logs directory +VOLUME ["/openim-chat/config", "/openim-chat/_output/logs"] -WORKDIR ${CHAT_WORKDIR} +# Set the command to run when the container starts +ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] -COPY --from=builder ${OPENIM_CHAT_BINDIR} /openim/openim-chat/_output/bin -COPY --from=builder ${CHAT_WORKDIR}/config /openim/openim-chat/config -COPY --from=builder ${CHAT_WORKDIR}/scripts /openim/openim-chat/scripts -COPY --from=builder ${CHAT_WORKDIR}/deployments /openim/openim-chat/deployments -CMD ["/openim/openim-chat/scripts/docker-start-all.sh"] From 0ed15f98f99f0770c1482c9cb549af35b348980d Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Mon, 22 Apr 2024 21:24:04 +0800 Subject: [PATCH 02/41] refactor dockerFile --- Dockerfile | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 456dc2ba2..3572079d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,26 @@ # Use Go 1.21 as the base image for building the application FROM golang:1.21 as builder -# Set the working directory inside the container -WORKDIR /openim-chat +# Define the base directory for the application as an environment variable +ENV OPENIM_SERVER_DIR=/openim-chat + +# Set the working directory inside the container based on the environment variable +WORKDIR $OPENIM_SERVER_DIR # Set the Go proxy to improve dependency resolution speed ENV GOPROXY=https://goproxy.cn,direct +# Copy go.mod and go.sum files first to leverage Docker cache COPY go.mod go.sum ./ RUN go mod download + # Copy all files from the current directory into the container COPY . . - +# Install Mage to use for building the application RUN go install github.com/magefile/mage@latest +# Execute the build command using Mage RUN mage build # Use Alpine Linux as the final base image due to its small size and included utilities @@ -24,16 +30,18 @@ FROM alpine:latest RUN apk add --no-cache bash # Copy the compiled binaries and mage from the builder image to the final image -COPY --from=builder /openim-chat/_output /openim-chat/_output +COPY --from=builder $OPENIM_SERVER_DIR/_output $OPENIM_SERVER_DIR/_output COPY --from=builder /go/bin/mage /usr/local/bin/mage +COPY --from=builder $OPENIM_SERVER_DIR/magefile_windows.go $OPENIM_SERVER_DIR/ +COPY --from=builder $OPENIM_SERVER_DIR/magefile_unix.go $OPENIM_SERVER_DIR/ +COPY --from=builder $OPENIM_SERVER_DIR/magefile.go $OPENIM_SERVER_DIR/ +COPY --from=builder $OPENIM_SERVER_DIR/start-config.yml $OPENIM_SERVER_DIR/ -# Set the working directory to /openim-chat within the container -WORKDIR /openim-chat +# Set the working directory to the application directory within the container +WORKDIR $OPENIM_SERVER_DIR # Set up volume mounts for the configuration directory and logs directory -VOLUME ["/openim-chat/config", "/openim-chat/_output/logs"] +VOLUME ["$OPENIM_SERVER_DIR/config", "$OPENIM_SERVER_DIR/_output/logs"] # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] - - From d3f501ab6853f2c7cb421b9aaa80b5487bc44029 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Mon, 22 Apr 2024 21:46:55 +0800 Subject: [PATCH 03/41] refactor dockerFile --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 3572079d6..5890fb564 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,6 +26,9 @@ RUN mage build # Use Alpine Linux as the final base image due to its small size and included utilities FROM alpine:latest +# Define the base directory for the application as an environment variable again +ENV OPENIM_SERVER_DIR=/openim-server + # Install necessary packages, such as bash, to ensure compatibility and functionality RUN apk add --no-cache bash From 6e7297fd02a750b51d783206b5434e8afed93e1f Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 09:31:20 +0800 Subject: [PATCH 04/41] refactor dockerFile --- Dockerfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5890fb564..3572079d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,9 +26,6 @@ RUN mage build # Use Alpine Linux as the final base image due to its small size and included utilities FROM alpine:latest -# Define the base directory for the application as an environment variable again -ENV OPENIM_SERVER_DIR=/openim-server - # Install necessary packages, such as bash, to ensure compatibility and functionality RUN apk add --no-cache bash From f61d4e8468317dc3ea5a08760859951394ec053f Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 09:36:42 +0800 Subject: [PATCH 05/41] refactor dockerFile --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index ea171e8a3..811715820 100644 --- a/.gitignore +++ b/.gitignore @@ -374,4 +374,3 @@ dist # config files, may contain sensitive informatio config/config.yaml -start-config.yml \ No newline at end of file From b19131179c9c09bad9064a250dbda54eba1ef638 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 09:45:59 +0800 Subject: [PATCH 06/41] refactor dockerFile --- start-config.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 start-config.yml diff --git a/start-config.yml b/start-config.yml new file mode 100644 index 000000000..b5b8ddc55 --- /dev/null +++ b/start-config.yml @@ -0,0 +1,8 @@ +serviceBinaries: + chat-api: 1 + chat-rpc: 1 + admin-api: 1 + admin-rpc: 1 +toolBinaries: + - check-component +maxFileDescriptors: 10000 From 92c39e2715a36a7f218aa510b000ae819b91ab0f Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 09:46:31 +0800 Subject: [PATCH 07/41] refactor dockerFile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3572079d6..6e590ed77 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ COPY . . RUN go install github.com/magefile/mage@latest # Execute the build command using Mage -RUN mage build +#RUN mage build # Use Alpine Linux as the final base image due to its small size and included utilities FROM alpine:latest From 6fa845d5363b0bade6f4019626ef0e242d559b36 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 09:57:58 +0800 Subject: [PATCH 08/41] refactor dockerFile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6e590ed77..1d16328f8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,7 @@ COPY . . # Install Mage to use for building the application RUN go install github.com/magefile/mage@latest -# Execute the build command using Mage +# Uncomment and ensure your build command is correctly specified #RUN mage build # Use Alpine Linux as the final base image due to its small size and included utilities From 03abb3094de5f650b897008be7971828c8e61cae Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 10:11:02 +0800 Subject: [PATCH 09/41] refactor dockerFile --- Dockerfile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1d16328f8..a628ee679 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,12 +10,13 @@ WORKDIR $OPENIM_SERVER_DIR # Set the Go proxy to improve dependency resolution speed ENV GOPROXY=https://goproxy.cn,direct +# Copy all files from the current directory into the container +COPY . . + # Copy go.mod and go.sum files first to leverage Docker cache COPY go.mod go.sum ./ RUN go mod download -# Copy all files from the current directory into the container -COPY . . # Install Mage to use for building the application RUN go install github.com/magefile/mage@latest @@ -37,9 +38,6 @@ COPY --from=builder $OPENIM_SERVER_DIR/magefile_unix.go $OPENIM_SERVER_DIR/ COPY --from=builder $OPENIM_SERVER_DIR/magefile.go $OPENIM_SERVER_DIR/ COPY --from=builder $OPENIM_SERVER_DIR/start-config.yml $OPENIM_SERVER_DIR/ -# Set the working directory to the application directory within the container -WORKDIR $OPENIM_SERVER_DIR - # Set up volume mounts for the configuration directory and logs directory VOLUME ["$OPENIM_SERVER_DIR/config", "$OPENIM_SERVER_DIR/_output/logs"] From 9e5fba8087eb1afbd364144516bc1f3a19cf7f53 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 10:17:11 +0800 Subject: [PATCH 10/41] refactor dockerFile --- Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Dockerfile b/Dockerfile index a628ee679..49b98b9fe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,6 +30,12 @@ FROM alpine:latest # Install necessary packages, such as bash, to ensure compatibility and functionality RUN apk add --no-cache bash +ENV OPENIM_SERVER_DIR=/openim-chat + +# Set the working directory inside the container based on the environment variable +WORKDIR $OPENIM_SERVER_DIR + + # Copy the compiled binaries and mage from the builder image to the final image COPY --from=builder $OPENIM_SERVER_DIR/_output $OPENIM_SERVER_DIR/_output COPY --from=builder /go/bin/mage /usr/local/bin/mage From ac12c2338344b627d695c7d1862ad36775fdc406 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 10:18:12 +0800 Subject: [PATCH 11/41] refactor dockerFile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 49b98b9fe..b033d1ba4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,7 +37,7 @@ WORKDIR $OPENIM_SERVER_DIR # Copy the compiled binaries and mage from the builder image to the final image -COPY --from=builder $OPENIM_SERVER_DIR/_output $OPENIM_SERVER_DIR/_output +COPY --from=builder $OPENIM_SERVER_DIR/_output $OPENIM_SERVER_DIR/ COPY --from=builder /go/bin/mage /usr/local/bin/mage COPY --from=builder $OPENIM_SERVER_DIR/magefile_windows.go $OPENIM_SERVER_DIR/ COPY --from=builder $OPENIM_SERVER_DIR/magefile_unix.go $OPENIM_SERVER_DIR/ From 2f560dcf45b5ef0f2143dfaf31efe87ad89af454 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 10:21:12 +0800 Subject: [PATCH 12/41] refactor dockerFile --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index b033d1ba4..9fd4fa9a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,9 +37,9 @@ WORKDIR $OPENIM_SERVER_DIR # Copy the compiled binaries and mage from the builder image to the final image -COPY --from=builder $OPENIM_SERVER_DIR/_output $OPENIM_SERVER_DIR/ -COPY --from=builder /go/bin/mage /usr/local/bin/mage -COPY --from=builder $OPENIM_SERVER_DIR/magefile_windows.go $OPENIM_SERVER_DIR/ +COPY $OPENIM_SERVER_DIR/_output $OPENIM_SERVER_DIR/ +COPY /go/bin/mage /usr/local/bin/mage +COPY $OPENIM_SERVER_DIR/magefile_windows.go $OPENIM_SERVER_DIR/ COPY --from=builder $OPENIM_SERVER_DIR/magefile_unix.go $OPENIM_SERVER_DIR/ COPY --from=builder $OPENIM_SERVER_DIR/magefile.go $OPENIM_SERVER_DIR/ COPY --from=builder $OPENIM_SERVER_DIR/start-config.yml $OPENIM_SERVER_DIR/ From 7d200828059a0686e60e9def673fa125b6fd3167 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 10:23:49 +0800 Subject: [PATCH 13/41] refactor dockerFile --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9fd4fa9a1..3d3505ac2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,9 +37,9 @@ WORKDIR $OPENIM_SERVER_DIR # Copy the compiled binaries and mage from the builder image to the final image -COPY $OPENIM_SERVER_DIR/_output $OPENIM_SERVER_DIR/ -COPY /go/bin/mage /usr/local/bin/mage -COPY $OPENIM_SERVER_DIR/magefile_windows.go $OPENIM_SERVER_DIR/ +#COPY --from=builder $OPENIM_SERVER_DIR/_output $OPENIM_SERVER_DIR/ +COPY --from=builder /go/bin/mage /usr/local/bin/mage +COPY --from=builder $OPENIM_SERVER_DIR/magefile_windows.go $OPENIM_SERVER_DIR/ COPY --from=builder $OPENIM_SERVER_DIR/magefile_unix.go $OPENIM_SERVER_DIR/ COPY --from=builder $OPENIM_SERVER_DIR/magefile.go $OPENIM_SERVER_DIR/ COPY --from=builder $OPENIM_SERVER_DIR/start-config.yml $OPENIM_SERVER_DIR/ From 08cc72795439853426b933c107ac9a9bdecfc7e1 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 10:28:56 +0800 Subject: [PATCH 14/41] refactor dockerFile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 3d3505ac2..052be0b9e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,6 +38,7 @@ WORKDIR $OPENIM_SERVER_DIR # Copy the compiled binaries and mage from the builder image to the final image #COPY --from=builder $OPENIM_SERVER_DIR/_output $OPENIM_SERVER_DIR/ +COPY --from=builder /openim-chat/_output /openim-chat/ COPY --from=builder /go/bin/mage /usr/local/bin/mage COPY --from=builder $OPENIM_SERVER_DIR/magefile_windows.go $OPENIM_SERVER_DIR/ COPY --from=builder $OPENIM_SERVER_DIR/magefile_unix.go $OPENIM_SERVER_DIR/ From 005617e0badbf7bb855019a6590488b55290e60a Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 10:31:12 +0800 Subject: [PATCH 15/41] refactor dockerFile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 052be0b9e..8b4ecb3ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,6 +35,7 @@ ENV OPENIM_SERVER_DIR=/openim-chat # Set the working directory inside the container based on the environment variable WORKDIR $OPENIM_SERVER_DIR +RUN ls -la $OPENIM_SERVER_DIR # Copy the compiled binaries and mage from the builder image to the final image #COPY --from=builder $OPENIM_SERVER_DIR/_output $OPENIM_SERVER_DIR/ From 762de2d4a456d7f3ca6f61a29c4949acd1fc1788 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 10:35:36 +0800 Subject: [PATCH 16/41] refactor dockerFile --- Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Dockerfile b/Dockerfile index 8b4ecb3ae..905a94603 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,6 +24,10 @@ RUN go install github.com/magefile/mage@latest # Uncomment and ensure your build command is correctly specified #RUN mage build +RUN ls -la $OPENIM_SERVER_DIR + + + # Use Alpine Linux as the final base image due to its small size and included utilities FROM alpine:latest @@ -35,6 +39,7 @@ ENV OPENIM_SERVER_DIR=/openim-chat # Set the working directory inside the container based on the environment variable WORKDIR $OPENIM_SERVER_DIR + RUN ls -la $OPENIM_SERVER_DIR # Copy the compiled binaries and mage from the builder image to the final image From 1c517e4b527908a342f2292f999a0524b611259f Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 10:39:30 +0800 Subject: [PATCH 17/41] refactor dockerFile --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 905a94603..1fe3508c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,6 +51,8 @@ COPY --from=builder $OPENIM_SERVER_DIR/magefile_unix.go $OPENIM_SERVER_DIR/ COPY --from=builder $OPENIM_SERVER_DIR/magefile.go $OPENIM_SERVER_DIR/ COPY --from=builder $OPENIM_SERVER_DIR/start-config.yml $OPENIM_SERVER_DIR/ +RUN ls -la $OPENIM_SERVER_DIR + # Set up volume mounts for the configuration directory and logs directory VOLUME ["$OPENIM_SERVER_DIR/config", "$OPENIM_SERVER_DIR/_output/logs"] From 8e284923408689a48badbf77ec7ef88f5b0c66e7 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 10:40:33 +0800 Subject: [PATCH 18/41] refactor dockerFile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1fe3508c3..96c4a36d7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,7 +44,7 @@ RUN ls -la $OPENIM_SERVER_DIR # Copy the compiled binaries and mage from the builder image to the final image #COPY --from=builder $OPENIM_SERVER_DIR/_output $OPENIM_SERVER_DIR/ -COPY --from=builder /openim-chat/_output /openim-chat/ +#COPY --from=builder /openim-chat/_output /openim-chat/ COPY --from=builder /go/bin/mage /usr/local/bin/mage COPY --from=builder $OPENIM_SERVER_DIR/magefile_windows.go $OPENIM_SERVER_DIR/ COPY --from=builder $OPENIM_SERVER_DIR/magefile_unix.go $OPENIM_SERVER_DIR/ From e6efeed78feb329bb992410d852d220e166bc406 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 10:46:05 +0800 Subject: [PATCH 19/41] refactor dockerFile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 96c4a36d7..09898b008 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,7 +51,7 @@ COPY --from=builder $OPENIM_SERVER_DIR/magefile_unix.go $OPENIM_SERVER_DIR/ COPY --from=builder $OPENIM_SERVER_DIR/magefile.go $OPENIM_SERVER_DIR/ COPY --from=builder $OPENIM_SERVER_DIR/start-config.yml $OPENIM_SERVER_DIR/ -RUN ls -la $OPENIM_SERVER_DIR +RUN ls -la $OPENIM_SERVER_DIR && false # Set up volume mounts for the configuration directory and logs directory VOLUME ["$OPENIM_SERVER_DIR/config", "$OPENIM_SERVER_DIR/_output/logs"] From 66a2ba9496227d815ba5239603c62d52a65ccef3 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 10:49:08 +0800 Subject: [PATCH 20/41] refactor dockerFile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 09898b008..51809b4a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,7 @@ RUN go install github.com/magefile/mage@latest # Uncomment and ensure your build command is correctly specified #RUN mage build -RUN ls -la $OPENIM_SERVER_DIR +RUN ls -la $OPENIM_SERVER_DIR && false From 76ca4405c45739ac2a089f9ce932b891698f31e7 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 11:08:11 +0800 Subject: [PATCH 21/41] refactor dockerFile --- .dockerignore | 3 --- Dockerfile | 32 +++++++++++++------------------- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/.dockerignore b/.dockerignore index a118b899f..522fb558b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,7 +4,6 @@ .dockerignore # Ignore build artifacts -_output/ logs/ # Ignore non-essential documentation @@ -17,8 +16,6 @@ CHANGELOG/ # Ignore testing and linting configuration .golangci.yml -# Ignore deployment-related files -docker-compose.yaml # Ignore assets assets/ diff --git a/Dockerfile b/Dockerfile index 51809b4a5..8c204c08c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,19 +2,17 @@ FROM golang:1.21 as builder # Define the base directory for the application as an environment variable -ENV OPENIM_SERVER_DIR=/openim-chat +ENV SERVER_DIR=/openim-chat # Set the working directory inside the container based on the environment variable -WORKDIR $OPENIM_SERVER_DIR +WORKDIR $SERVER_DIR # Set the Go proxy to improve dependency resolution speed -ENV GOPROXY=https://goproxy.cn,direct +ENV GOPROXY=https://goproxy.io,direct # Copy all files from the current directory into the container COPY . . -# Copy go.mod and go.sum files first to leverage Docker cache -COPY go.mod go.sum ./ RUN go mod download @@ -24,9 +22,6 @@ RUN go install github.com/magefile/mage@latest # Uncomment and ensure your build command is correctly specified #RUN mage build -RUN ls -la $OPENIM_SERVER_DIR && false - - # Use Alpine Linux as the final base image due to its small size and included utilities FROM alpine:latest @@ -34,27 +29,26 @@ FROM alpine:latest # Install necessary packages, such as bash, to ensure compatibility and functionality RUN apk add --no-cache bash -ENV OPENIM_SERVER_DIR=/openim-chat +ENV SERVER_DIR=/openim-chat # Set the working directory inside the container based on the environment variable -WORKDIR $OPENIM_SERVER_DIR +WORKDIR $SERVER_DIR -RUN ls -la $OPENIM_SERVER_DIR # Copy the compiled binaries and mage from the builder image to the final image -#COPY --from=builder $OPENIM_SERVER_DIR/_output $OPENIM_SERVER_DIR/ -#COPY --from=builder /openim-chat/_output /openim-chat/ + +COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/config $SERVER_DIR/ COPY --from=builder /go/bin/mage /usr/local/bin/mage -COPY --from=builder $OPENIM_SERVER_DIR/magefile_windows.go $OPENIM_SERVER_DIR/ -COPY --from=builder $OPENIM_SERVER_DIR/magefile_unix.go $OPENIM_SERVER_DIR/ -COPY --from=builder $OPENIM_SERVER_DIR/magefile.go $OPENIM_SERVER_DIR/ -COPY --from=builder $OPENIM_SERVER_DIR/start-config.yml $OPENIM_SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile_windows.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile_unix.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/start-config.yml $SERVER_DIR/ -RUN ls -la $OPENIM_SERVER_DIR && false # Set up volume mounts for the configuration directory and logs directory -VOLUME ["$OPENIM_SERVER_DIR/config", "$OPENIM_SERVER_DIR/_output/logs"] +VOLUME ["$SERVER_DIR/config", "$SERVER_DIR/_output/logs"] # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] From a0ddd4e1a532d474bd18f7b8c2982ef3316106c4 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 11:22:15 +0800 Subject: [PATCH 22/41] refactor dockerFile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 8c204c08c..77598c139 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,6 +29,7 @@ FROM alpine:latest # Install necessary packages, such as bash, to ensure compatibility and functionality RUN apk add --no-cache bash +FROM golang:1.21-alpine ENV SERVER_DIR=/openim-chat # Set the working directory inside the container based on the environment variable From 0fb98fe0f9acfb16c89a533bf2cdca8b7a139ba8 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 11:30:51 +0800 Subject: [PATCH 23/41] refactor dockerFile --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 77598c139..8c204c08c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,6 @@ FROM alpine:latest # Install necessary packages, such as bash, to ensure compatibility and functionality RUN apk add --no-cache bash -FROM golang:1.21-alpine ENV SERVER_DIR=/openim-chat # Set the working directory inside the container based on the environment variable From 1544cd8c269ffa73b56014f27059db4ef8ad8550 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 11:33:39 +0800 Subject: [PATCH 24/41] refactor dockerFile --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 8c204c08c..2a40994a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,6 +45,8 @@ COPY --from=builder $SERVER_DIR/magefile_windows.go $SERVER_DIR/ COPY --from=builder $SERVER_DIR/magefile_unix.go $SERVER_DIR/ COPY --from=builder $SERVER_DIR/magefile.go $SERVER_DIR/ COPY --from=builder $SERVER_DIR/start-config.yml $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.mod $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/ # Set up volume mounts for the configuration directory and logs directory From 803aca4f8cc3eda9c18a15dc37455f0c348bb770 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 11:39:00 +0800 Subject: [PATCH 25/41] refactor dockerFile --- Dockerfile | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2a40994a9..6325b1a68 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -# Use Go 1.21 as the base image for building the application -FROM golang:1.21 as builder +# Use Go 1.21 Alpine as the base image for building the application +FROM golang:1.21-alpine as builder # Define the base directory for the application as an environment variable ENV SERVER_DIR=/openim-chat @@ -15,29 +15,23 @@ COPY . . RUN go mod download - # Install Mage to use for building the application RUN go install github.com/magefile/mage@latest -# Uncomment and ensure your build command is correctly specified -#RUN mage build - +# Optionally build your application if needed +# RUN mage build -# Use Alpine Linux as the final base image due to its small size and included utilities -FROM alpine:latest +# Using Alpine Linux with Go environment for the final image +FROM golang:1.21-alpine -# Install necessary packages, such as bash, to ensure compatibility and functionality +# Install necessary packages, such as bash RUN apk add --no-cache bash +# Set the environment and work directory ENV SERVER_DIR=/openim-chat - -# Set the working directory inside the container based on the environment variable WORKDIR $SERVER_DIR - - # Copy the compiled binaries and mage from the builder image to the final image - COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/ COPY --from=builder $SERVER_DIR/config $SERVER_DIR/ COPY --from=builder /go/bin/mage /usr/local/bin/mage @@ -48,7 +42,6 @@ COPY --from=builder $SERVER_DIR/start-config.yml $SERVER_DIR/ COPY --from=builder $SERVER_DIR/go.mod $SERVER_DIR/ COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/ - # Set up volume mounts for the configuration directory and logs directory VOLUME ["$SERVER_DIR/config", "$SERVER_DIR/_output/logs"] From 560fd75745dc60e200f04197e83c64a5e6cffeb0 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 11:42:43 +0800 Subject: [PATCH 26/41] refactor dockerFile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6325b1a68..3d151f078 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,8 +32,8 @@ ENV SERVER_DIR=/openim-chat WORKDIR $SERVER_DIR # Copy the compiled binaries and mage from the builder image to the final image -COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/ -COPY --from=builder $SERVER_DIR/config $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output +COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config COPY --from=builder /go/bin/mage /usr/local/bin/mage COPY --from=builder $SERVER_DIR/magefile_windows.go $SERVER_DIR/ COPY --from=builder $SERVER_DIR/magefile_unix.go $SERVER_DIR/ From 48f245a0acd282fb5bb7973d1c2a6311468f6193 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 11:52:23 +0800 Subject: [PATCH 27/41] refactor dockerFile --- Dockerfile | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3d151f078..f4238cf6c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,17 @@ -# Use Go 1.21 Alpine as the base image for building the application -FROM golang:1.21-alpine as builder +# Use Ubuntu 18.04 with Go installed as the base image for building the application +FROM ubuntu:18.04 as builder + +# Install Go and necessary tools +RUN apt-get update && apt-get install -y --no-install-recommends \ + golang-go \ + git \ + ca-certificates \ + && rm -rf /var/lib/apt/lists/* # Define the base directory for the application as an environment variable -ENV SERVER_DIR=/openim-chat +ENV SERVER_DIR=/openim-chat \ + GOPATH=/go \ + PATH=$GOPATH/bin:$PATH # Set the working directory inside the container based on the environment variable WORKDIR $SERVER_DIR @@ -13,27 +22,30 @@ ENV GOPROXY=https://goproxy.io,direct # Copy all files from the current directory into the container COPY . . +# Download dependencies RUN go mod download # Install Mage to use for building the application -RUN go install github.com/magefile/mage@latest +RUN go get -u github.com/magefile/mage # Optionally build your application if needed # RUN mage build -# Using Alpine Linux with Go environment for the final image -FROM golang:1.21-alpine +# Using Ubuntu 18.04 for the final image +FROM ubuntu:18.04 # Install necessary packages, such as bash -RUN apk add --no-cache bash +RUN apt-get update && apt-get install -y --no-install-recommends \ + bash \ + && rm -rf /var/lib/apt/lists/* # Set the environment and work directory ENV SERVER_DIR=/openim-chat WORKDIR $SERVER_DIR # Copy the compiled binaries and mage from the builder image to the final image -COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output -COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config +COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/config $SERVER_DIR/ COPY --from=builder /go/bin/mage /usr/local/bin/mage COPY --from=builder $SERVER_DIR/magefile_windows.go $SERVER_DIR/ COPY --from=builder $SERVER_DIR/magefile_unix.go $SERVER_DIR/ From 8df63810db1f147c27a326bceef0ebc7414d2560 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 12:02:57 +0800 Subject: [PATCH 28/41] refactor dockerFile --- Dockerfile | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index f4238cf6c..3ea4bf949 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,8 @@ -# Use Ubuntu 18.04 with Go installed as the base image for building the application -FROM ubuntu:18.04 as builder - -# Install Go and necessary tools -RUN apt-get update && apt-get install -y --no-install-recommends \ - golang-go \ - git \ - ca-certificates \ - && rm -rf /var/lib/apt/lists/* +# Use Go 1.21 Alpine as the base image for building the application +FROM golang:1.21-alpine as builder # Define the base directory for the application as an environment variable -ENV SERVER_DIR=/openim-chat \ - GOPATH=/go \ - PATH=$GOPATH/bin:$PATH +ENV SERVER_DIR=/openim-chat # Set the working directory inside the container based on the environment variable WORKDIR $SERVER_DIR @@ -22,30 +13,27 @@ ENV GOPROXY=https://goproxy.io,direct # Copy all files from the current directory into the container COPY . . -# Download dependencies RUN go mod download # Install Mage to use for building the application -RUN go get -u github.com/magefile/mage +RUN go install github.com/magefile/mage@latest # Optionally build your application if needed # RUN mage build -# Using Ubuntu 18.04 for the final image +# Using Alpine Linux with Go environment for the final image FROM ubuntu:18.04 # Install necessary packages, such as bash -RUN apt-get update && apt-get install -y --no-install-recommends \ - bash \ - && rm -rf /var/lib/apt/lists/* +RUN apk add --no-cache bash # Set the environment and work directory ENV SERVER_DIR=/openim-chat WORKDIR $SERVER_DIR # Copy the compiled binaries and mage from the builder image to the final image -COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/ -COPY --from=builder $SERVER_DIR/config $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output +COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config COPY --from=builder /go/bin/mage /usr/local/bin/mage COPY --from=builder $SERVER_DIR/magefile_windows.go $SERVER_DIR/ COPY --from=builder $SERVER_DIR/magefile_unix.go $SERVER_DIR/ From 7642345764f61ee03b2ad7dc627a2439296d73ab Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 12:04:04 +0800 Subject: [PATCH 29/41] refactor dockerFile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3ea4bf949..b313d8782 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,7 @@ RUN go install github.com/magefile/mage@latest FROM ubuntu:18.04 # Install necessary packages, such as bash -RUN apk add --no-cache bash +#RUN apk add --no-cache bash # Set the environment and work directory ENV SERVER_DIR=/openim-chat From 6b5106ba41c3ae73f33359cbb80aed4802cceb0d Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 12:05:55 +0800 Subject: [PATCH 30/41] refactor dockerFile --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index b313d8782..b8550e68c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,13 +19,13 @@ RUN go mod download RUN go install github.com/magefile/mage@latest # Optionally build your application if needed -# RUN mage build +RUN mage build # Using Alpine Linux with Go environment for the final image -FROM ubuntu:18.04 +FROM golang:1.21-alpine # Install necessary packages, such as bash -#RUN apk add --no-cache bash +RUN apk add --no-cache bash # Set the environment and work directory ENV SERVER_DIR=/openim-chat From b34632d21be66043c0bf0850ff50ece8b1425ae8 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 14:06:54 +0800 Subject: [PATCH 31/41] refactor dockerFile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b8550e68c..6217aa7c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,4 +46,4 @@ COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/ VOLUME ["$SERVER_DIR/config", "$SERVER_DIR/_output/logs"] # Set the command to run when the container starts -ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] +ENTRYPOINT ["sh", "-c", "mage start"] From 4841b03e633a1ee8badf0a28491927eb3bc12acd Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 15:18:50 +0800 Subject: [PATCH 32/41] refactor dockerFile --- Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6217aa7c8..f9cd02543 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,8 @@ RUN go install github.com/magefile/mage@latest # Optionally build your application if needed RUN mage build + + # Using Alpine Linux with Go environment for the final image FROM golang:1.21-alpine @@ -31,6 +33,8 @@ RUN apk add --no-cache bash ENV SERVER_DIR=/openim-chat WORKDIR $SERVER_DIR +RUN go get github.com/openimsdk/gomake@v0.0.6 + # Copy the compiled binaries and mage from the builder image to the final image COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config @@ -46,4 +50,4 @@ COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/ VOLUME ["$SERVER_DIR/config", "$SERVER_DIR/_output/logs"] # Set the command to run when the container starts -ENTRYPOINT ["sh", "-c", "mage start"] +ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] From 855010a8beb45db9d05620df4f50827ca45de23b Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 15:20:12 +0800 Subject: [PATCH 33/41] refactor dockerFile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index f9cd02543..34fbcf237 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,6 +46,7 @@ COPY --from=builder $SERVER_DIR/start-config.yml $SERVER_DIR/ COPY --from=builder $SERVER_DIR/go.mod $SERVER_DIR/ COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/ +RUN go get github.com/openimsdk/gomake@v0.0.6 # Set up volume mounts for the configuration directory and logs directory VOLUME ["$SERVER_DIR/config", "$SERVER_DIR/_output/logs"] From 91b2f7ade129301270660043a83863c1dc52fa8e Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 15:20:50 +0800 Subject: [PATCH 34/41] refactor dockerFile --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 34fbcf237..696299597 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,7 +33,6 @@ RUN apk add --no-cache bash ENV SERVER_DIR=/openim-chat WORKDIR $SERVER_DIR -RUN go get github.com/openimsdk/gomake@v0.0.6 # Copy the compiled binaries and mage from the builder image to the final image COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output From 87e74cb2f8f5399548eb8966e49fb0aacc0f7bcf Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 15:22:26 +0800 Subject: [PATCH 35/41] refactor dockerFile --- .dockerignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.dockerignore b/.dockerignore index 522fb558b..b52db5740 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,6 +5,7 @@ # Ignore build artifacts logs/ +_output/ # Ignore non-essential documentation README.md From 154f9c955ad40b57908bf16fc69f83ab3f403c1e Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 16:54:10 +0800 Subject: [PATCH 36/41] refactor dockerFile --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 696299597..6b938a6f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,7 +47,8 @@ COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/ RUN go get github.com/openimsdk/gomake@v0.0.6 # Set up volume mounts for the configuration directory and logs directory -VOLUME ["$SERVER_DIR/config", "$SERVER_DIR/_output/logs"] +#VOLUME ["/openim-chat/config", "/openim-chat/_output/logs"] +VOLUME ["/openim-chat/config", "/openim-chat/_output/logs"] # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] From 40f4ebf1520022ac02637b68fae488a8b6979d2d Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 18:17:23 +0800 Subject: [PATCH 37/41] refactor dockerFile --- Dockerfile | 7 +------ go.mod | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6b938a6f4..1e7bd1094 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,8 +21,6 @@ RUN go install github.com/magefile/mage@latest # Optionally build your application if needed RUN mage build - - # Using Alpine Linux with Go environment for the final image FROM golang:1.21-alpine @@ -45,10 +43,7 @@ COPY --from=builder $SERVER_DIR/start-config.yml $SERVER_DIR/ COPY --from=builder $SERVER_DIR/go.mod $SERVER_DIR/ COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/ -RUN go get github.com/openimsdk/gomake@v0.0.6 -# Set up volume mounts for the configuration directory and logs directory -#VOLUME ["/openim-chat/config", "/openim-chat/_output/logs"] -VOLUME ["/openim-chat/config", "/openim-chat/_output/logs"] +RUN go get github.com/openimsdk/gomake@v0.0.9-alpha.3 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/go.mod b/go.mod index 1357fd854..840a9d5a7 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( require ( github.com/livekit/protocol v1.10.1 github.com/mitchellh/mapstructure v1.5.0 - github.com/openimsdk/gomake v0.0.6 + github.com/openimsdk/gomake v0.0.9-alpha.3 github.com/openimsdk/protocol v0.0.63 github.com/openimsdk/tools v0.0.48 github.com/redis/go-redis/v9 v9.5.1 From 9364aaa90974626907d5dc21225455afcec8a932 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 18:18:53 +0800 Subject: [PATCH 38/41] refactor dockerFile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1e7bd1094..52e184104 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ COPY . . RUN go mod download # Install Mage to use for building the application -RUN go install github.com/magefile/mage@latest +RUN go install github.com/magefile/mage@v1.15.0 # Optionally build your application if needed RUN mage build From 657201beec06ff3434e27b903fe1f6755ecfba0a Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 18:22:09 +0800 Subject: [PATCH 39/41] refactor dockerFile --- go.sum | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go.sum b/go.sum index d4c9121bb..c359fd5d7 100644 --- a/go.sum +++ b/go.sum @@ -178,8 +178,8 @@ github.com/nats-io/nkeys v0.4.6/go.mod h1:4DxZNzenSVd1cYQoAa8948QY3QDjrHfcfVADym github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/openimsdk/gomake v0.0.6 h1:bJmQWDHBj8PQ7oGJ2SL3Gsx0k5CdI/BPfGzlGcV105s= -github.com/openimsdk/gomake v0.0.6/go.mod h1:PndCozNc2IsQIciyn9mvEblYWZwJmAI+06z94EY+csI= +github.com/openimsdk/gomake v0.0.9-alpha.3 h1:KO3stbmiTksnnx2o2Lh8/FkKXc7qiF4rwPnr01WO7aM= +github.com/openimsdk/gomake v0.0.9-alpha.3/go.mod h1:PndCozNc2IsQIciyn9mvEblYWZwJmAI+06z94EY+csI= github.com/openimsdk/protocol v0.0.63 h1:9DnweZe9nEYDFa4fGTbC9Cqi0gLUdtBhRo1NRP2X3WQ= github.com/openimsdk/protocol v0.0.63/go.mod h1:OZQA9FR55lseYoN2Ql1XAHYKHJGu7OMNkUbuekrKCM8= github.com/openimsdk/tools v0.0.48 h1:GgRtYtMNlJ0PzCR9XQzMVDv7O+Sp8Hg9Grrlnh8HFGE= From ebca82544b8f2a383688c4ae954aa2f53dd23f21 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 18:25:23 +0800 Subject: [PATCH 40/41] refactor dockerFile --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 840a9d5a7..ffe1c36f8 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/mitchellh/mapstructure v1.5.0 github.com/openimsdk/gomake v0.0.9-alpha.3 github.com/openimsdk/protocol v0.0.63 - github.com/openimsdk/tools v0.0.48 + github.com/openimsdk/tools v0.0.49-alpha.2 github.com/redis/go-redis/v9 v9.5.1 github.com/spf13/cobra v1.8.0 github.com/spf13/viper v1.18.2 From 7f9222dd1f06e1a4864bbcaf1ce293c9fb1ace9e Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Apr 2024 18:26:04 +0800 Subject: [PATCH 41/41] refactor dockerFile --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index ffe1c36f8..840a9d5a7 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/mitchellh/mapstructure v1.5.0 github.com/openimsdk/gomake v0.0.9-alpha.3 github.com/openimsdk/protocol v0.0.63 - github.com/openimsdk/tools v0.0.49-alpha.2 + github.com/openimsdk/tools v0.0.48 github.com/redis/go-redis/v9 v9.5.1 github.com/spf13/cobra v1.8.0 github.com/spf13/viper v1.18.2