fix: docker images optimize

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
Xinwei Xiong(cubxxw-openim) 2023-08-03 15:43:53 +08:00
parent f9f604b4b9
commit 59e3eeb0a3
No known key found for this signature in database
GPG Key ID: 1BAD6F395338EFDE
15 changed files with 22 additions and 17 deletions

View File

@ -19,7 +19,7 @@ ADD . .
RUN /bin/sh -c "make clean"
RUN /bin/sh -c "make build"
FROM ghcr.io/openim-sigs/openim-bash-image:v1.2.0
FROM ghcr.io/openim-sigs/openim-bash-image:v1.3.0
WORKDIR ${SERVER_WORKDIR}
@ -28,4 +28,4 @@ COPY --from=builder ${OPENIM_SERVER_CMDDIR} /openim/openim-server/scripts
COPY --from=builder ${SERVER_WORKDIR}/config /openim/openim-server/config
COPY --from=builder ${SERVER_WORKDIR}/_output/bin/platforms /openim/openim-server/_output/bin/platforms
CMD ["sh","-c","${OPENIM_SERVER_CMDDIR}/docker_start_all.sh"]
CMD ["bash","-c","${OPENIM_SERVER_CMDDIR}/docker_start_all.sh"]

View File

@ -20,7 +20,7 @@ COPY . .
RUN make clean
RUN make build BINS=openim-api
FROM ghcr.io/openim-sigs/openim-bash-image:v1.2.0
FROM ghcr.io/openim-sigs/openim-bash-image:v1.3.0
WORKDIR /openim/openim-server

View File

@ -21,7 +21,7 @@ RUN go mod download
RUN make clean
RUN make build BINS=openim-cmdutils
FROM ghcr.io/openim-sigs/openim-bash-image:v1.2.0
FROM ghcr.io/openim-sigs/openim-bash-image:v1.3.0
WORKDIR /openim/openim-server

View File

@ -12,13 +12,15 @@ WORKDIR /openim/openim-server
ENV GO111MODULE=$GO111MODULE
ENV GOPROXY=$GOPROXY
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go mod download
RUN make clean
RUN make build BINS=openim-crontask
FROM ghcr.io/openim-sigs/openim-bash-image:v1.2.0
FROM ghcr.io/openim-sigs/openim-bash-image:v1.3.0
WORKDIR /openim/openim-server

View File

@ -20,7 +20,7 @@ COPY . .
RUN make clean
RUN make build BINS=openim-msggateway
FROM ghcr.io/openim-sigs/openim-bash-image:v1.2.0
FROM ghcr.io/openim-sigs/openim-bash-image:v1.3.0
WORKDIR /openim/openim-server

View File

@ -20,7 +20,7 @@ COPY . .
RUN make clean
RUN make build BINS=openim-msgtransfer
FROM ghcr.io/openim-sigs/openim-bash-image:v1.2.0
FROM ghcr.io/openim-sigs/openim-bash-image:v1.3.0
ENV OS ${OS}
ENV ARCH ${ARCH}

View File

@ -12,6 +12,9 @@ WORKDIR /openim/openim-server
ENV GO111MODULE=$GO111MODULE
ENV GOPROXY=$GOPROXY
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN make clean

View File

@ -21,7 +21,7 @@ RUN make clean
# RUN make build BINS=openim-rpc
RUN go build -o ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-auth ./cmd/openim-rpc/openim-rpc-auth
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
FROM ghcr.io/openim-sigs/openim-bash-image:v1.3.0

View File

@ -20,7 +20,7 @@ COPY . .
RUN make clean
RUN make build BINS=openim-rpc
# RUN go build -o ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-conversation ./cmd/openim-rpc/openim-rpc-conversation
# 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 && \

View File

@ -20,7 +20,7 @@ COPY . .
RUN make clean
RUN make build BINS=openim-rpc
# RUN go build -o ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-friend ./cmd/openim-rpc/openim-rpc-friend
# 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 && \

View File

@ -20,7 +20,7 @@ COPY . .
RUN make clean
RUN make build BINS=openim-rpc
# RUN go build -o ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-group ./cmd/openim-rpc/openim-rpc-group
# 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 && \

View File

@ -20,7 +20,7 @@ COPY . .
RUN make clean
RUN make build BINS=openim-rpc
# RUN go build -o ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-msg ./cmd/openim-rpc/openim-rpc-msg
# 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 && \

View File

@ -20,7 +20,7 @@ COPY . .
RUN make clean
RUN make build BINS=openim-rpc
# RUN go build -o ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-third ./cmd/openim-rpc/openim-rpc-third
# 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 && \

View File

@ -20,7 +20,7 @@ COPY . .
RUN make clean
RUN make build BINS=openim-rpc
# RUN go build -o ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-user ./cmd/openim-rpc/openim-rpc-user
# 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 && \

View File

@ -100,7 +100,7 @@ services:
openim_server:
image: ghcr.io/openimsdk/openim-server:main
image: openim-server:v1 #ghcr.io/openimsdk/openim-server:main
container_name: openim-server
volumes:
- ./logs:/openim/openim-server/logs
@ -122,7 +122,7 @@ services:
max-file: "2"
openim_chat:
image: ghcr.io/openimsdk/openim-chat:main
image: openim-chat:v1 #ghcr.io/openimsdk/openim-chat:main
container_name: openim_chat
volumes:
- ./_output/openim/openim-chat/logs:/openim/openim-chat/logs