parent
1614ca1def
commit
1c1e05a8eb
@ -0,0 +1,24 @@
|
||||
FROM golang as build
|
||||
|
||||
# go mod Installation source, container environment variable addition will override the default variable value
|
||||
ENV GO111MODULE=on
|
||||
ENV GOPROXY=https://goproxy.cn,direct
|
||||
|
||||
COPY ../* ./Open-IM-Server
|
||||
ENV WORKDIR /Open-IM-Server/cmd/api
|
||||
|
||||
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
|
||||
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
|
||||
RUN apt-get -qq update \
|
||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
||||
|
||||
RUN make build
|
||||
|
||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
||||
|
||||
CMD ["${WORKDIR}/open_im_api","--port", "10002"]
|
@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
version=errcode
|
||||
repository=${1}
|
||||
|
||||
set +e
|
||||
echo "repository: ${repository}"
|
||||
source ./path_info.cfg
|
||||
echo "start to build docker images"
|
||||
currentPwd=${pwd}
|
||||
i=0
|
||||
for path in ${service_source_root[*]}
|
||||
do
|
||||
image="${repository}/${image_names[${i}]}:$version"
|
||||
echo ${image}
|
||||
docker build -t $image . -f ${path}/deploy.Dockerfile
|
||||
echo "build ${image} success"
|
||||
docker push ${image}
|
||||
echo "push ${image} success"
|
||||
echo "=============================="
|
||||
i=$((i + 1))
|
||||
done
|
||||
|
||||
echo "build all images success"
|
Loading…
Reference in new issue