2021-07-29 11:30:48 +00:00
|
|
|
FROM amd64/buildpack-deps:buster-curl as installer
|
|
|
|
|
2024-04-03 07:37:59 +00:00
|
|
|
ARG NACOS_VERSION=2.3.2
|
2021-07-29 11:30:48 +00:00
|
|
|
ARG HOT_FIX_FLAG=""
|
|
|
|
|
|
|
|
RUN set -x \
|
|
|
|
&& curl -SL --output /var/tmp/nacos-server.tar.gz https://github.com/alibaba/nacos/releases/download/${NACOS_VERSION}${HOT_FIX_FLAG}/nacos-server-${NACOS_VERSION}.tar.gz \
|
|
|
|
&& tar -xzvf /var/tmp/nacos-server.tar.gz -C /home \
|
|
|
|
&& rm -rf /var/tmp/nacos-server.tar.gz /home/nacos/bin/* /home/nacos/conf/*.properties /home/nacos/conf/*.example /home/nacos/conf/nacos-mysql.sql
|
|
|
|
|
2023-06-02 01:46:16 +00:00
|
|
|
FROM adoptopenjdk/openjdk8:jre8u372-b07
|
2021-07-29 11:30:48 +00:00
|
|
|
|
|
|
|
# set environment
|
|
|
|
ENV MODE="cluster" \
|
|
|
|
PREFER_HOST_MODE="ip"\
|
|
|
|
BASE_DIR="/home/nacos" \
|
|
|
|
CLASSPATH=".:/home/nacos/conf:$CLASSPATH" \
|
|
|
|
CLUSTER_CONF="/home/nacos/conf/cluster.conf" \
|
|
|
|
FUNCTION_MODE="all" \
|
|
|
|
NACOS_USER="nacos" \
|
2023-06-02 01:46:16 +00:00
|
|
|
JAVA="/opt/java/openjdk/bin/java" \
|
2021-07-29 11:30:48 +00:00
|
|
|
JVM_XMS="1g" \
|
|
|
|
JVM_XMX="1g" \
|
|
|
|
JVM_XMN="512m" \
|
|
|
|
JVM_MS="128m" \
|
|
|
|
JVM_MMS="320m" \
|
|
|
|
NACOS_DEBUG="n" \
|
|
|
|
TOMCAT_ACCESSLOG_ENABLED="false" \
|
|
|
|
TZ="Asia/Shanghai"
|
|
|
|
|
|
|
|
WORKDIR $BASE_DIR
|
|
|
|
|
|
|
|
# copy nacos bin
|
|
|
|
COPY --from=installer ["/home/nacos", "/home/nacos"]
|
|
|
|
|
|
|
|
ADD bin/docker-startup.sh bin/docker-startup.sh
|
|
|
|
ADD conf/application.properties conf/application.properties
|
|
|
|
|
|
|
|
# set startup log dir
|
|
|
|
RUN mkdir -p logs \
|
|
|
|
&& cd logs \
|
|
|
|
&& touch start.out \
|
|
|
|
&& ln -sf /dev/stdout start.out \
|
|
|
|
&& ln -sf /dev/stderr start.out
|
|
|
|
RUN chmod +x bin/docker-startup.sh
|
|
|
|
|
|
|
|
EXPOSE 8848
|
|
|
|
ENTRYPOINT ["bin/docker-startup.sh"]
|