mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
feat(main): dockerfile fix
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
parent
fdbc60eef1
commit
61ea5b1912
10
Makefile
10
Makefile
@ -70,6 +70,10 @@ tidy:
|
|||||||
vendor:
|
vendor:
|
||||||
@$(GO) mod vendor
|
@$(GO) mod vendor
|
||||||
|
|
||||||
|
## style: code style -> fmt,vet,lint
|
||||||
|
.PHONY: style
|
||||||
|
style: fmt vet lint
|
||||||
|
|
||||||
## fmt: Run go fmt against code.
|
## fmt: Run go fmt against code.
|
||||||
.PHONY: fmt
|
.PHONY: fmt
|
||||||
fmt:
|
fmt:
|
||||||
@ -85,13 +89,9 @@ vet:
|
|||||||
lint:
|
lint:
|
||||||
@$(MAKE) go.lint
|
@$(MAKE) go.lint
|
||||||
|
|
||||||
## style: code style -> fmt,vet,lint
|
|
||||||
.PHONY: style
|
|
||||||
style: fmt vet lint
|
|
||||||
|
|
||||||
## format: Gofmt (reformat) package sources (exclude vendor dir if existed).
|
## format: Gofmt (reformat) package sources (exclude vendor dir if existed).
|
||||||
.PHONY: format
|
.PHONY: format
|
||||||
format:
|
format:
|
||||||
@$(MAKE) go.format
|
@$(MAKE) go.format
|
||||||
|
|
||||||
## test: Run unit test.
|
## test: Run unit test.
|
||||||
|
@ -6,34 +6,29 @@ ENV GOPROXY=https://goproxy.cn,direct
|
|||||||
|
|
||||||
# Set up the working directory
|
# Set up the working directory
|
||||||
WORKDIR /Open-IM-Server
|
WORKDIR /Open-IM-Server
|
||||||
|
|
||||||
# add all files to the container
|
# add all files to the container
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/script
|
RUN chmod +x /Open-IM-Server/script/*.sh && \
|
||||||
RUN chmod +x *.sh
|
/bin/sh -c /Open-IM-Server/script/build_all_service.sh
|
||||||
|
|
||||||
RUN /bin/sh -c ./build_all_service.sh
|
|
||||||
|
|
||||||
#Blank image Multi-Stage Build
|
#Blank image Multi-Stage Build
|
||||||
FROM ubuntu
|
FROM alpine
|
||||||
|
|
||||||
|
RUN apk add --no-cache vim curl tzdata gawk procps net-tools
|
||||||
|
|
||||||
RUN rm -rf /var/lib/apt/lists/*
|
|
||||||
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
|
||||||
&&apt-get install net-tools
|
|
||||||
#Non-interactive operation
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
RUN apt-get install -y vim curl tzdata gawk
|
|
||||||
#Time zone adjusted to East eighth District
|
#Time zone adjusted to East eighth District
|
||||||
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
|
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
|
||||||
|
dpkg-reconfigure -f noninteractive tzdata
|
||||||
|
|
||||||
#set directory to map logs,config file,script file.
|
#set directory to map logs,config file,script file.
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script","/Open-IM-Server/db/sdk"]
|
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script","/Open-IM-Server/db/sdk"]
|
||||||
|
|
||||||
#Copy script files and binary files to the blank image
|
#Copy script files and binary files to the blank image
|
||||||
COPY --from=build /Open-IM-Server/script /Open-IM-Server/script
|
COPY --from=build --chown=root:root /Open-IM-Server/script /Open-IM-Server/script
|
||||||
COPY --from=build /Open-IM-Server/bin /Open-IM-Server/bin
|
COPY --from=build --chown=root:root /Open-IM-Server/bin /Open-IM-Server/bin
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/script
|
WORKDIR /Open-IM-Server/script
|
||||||
|
|
||||||
CMD ["./docker_start_all.sh"]
|
CMD ["/Open-IM-Server/script/docker_start_all.sh"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user