2019-05-22 08:18:41 +00:00
|
|
|
FROM centos:7.5.1804
|
|
|
|
MAINTAINER pader "huangmnlove@163.com"
|
|
|
|
|
|
|
|
# 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" \
|
|
|
|
JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk" \
|
|
|
|
NACOS_USER="nacos" \
|
|
|
|
JAVA="/usr/lib/jvm/java-1.8.0-openjdk/bin/java" \
|
2021-03-21 07:13:03 +00:00
|
|
|
JVM_XMS="1g" \
|
|
|
|
JVM_XMX="1g" \
|
|
|
|
JVM_XMN="512m" \
|
2019-07-07 14:35:44 +00:00
|
|
|
JVM_MS="128m" \
|
|
|
|
JVM_MMS="320m" \
|
|
|
|
NACOS_DEBUG="n" \
|
2019-07-07 15:42:18 +00:00
|
|
|
TOMCAT_ACCESSLOG_ENABLED="false" \
|
2019-05-22 08:18:41 +00:00
|
|
|
TIME_ZONE="Asia/Shanghai"
|
|
|
|
|
2021-07-28 14:11:46 +00:00
|
|
|
ARG NACOS_VERSION=2.0.3
|
2021-04-30 17:22:24 +00:00
|
|
|
ARG HOT_FIX_FLAG=""
|
2019-05-22 08:18:41 +00:00
|
|
|
|
2021-03-21 07:13:03 +00:00
|
|
|
WORKDIR $BASE_DIR
|
2019-05-22 08:18:41 +00:00
|
|
|
|
|
|
|
RUN set -x \
|
|
|
|
&& yum update -y \
|
2020-07-10 14:57:53 +00:00
|
|
|
&& yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel wget iputils nc vim libcurl
|
2021-04-03 17:51:06 +00:00
|
|
|
RUN wget https://github.com/alibaba/nacos/releases/download/${NACOS_VERSION}${HOT_FIX_FLAG}/nacos-server-${NACOS_VERSION}.tar.gz -P /home
|
2020-07-10 14:57:53 +00:00
|
|
|
RUN tar -xzvf /home/nacos-server-${NACOS_VERSION}.tar.gz -C /home \
|
|
|
|
&& rm -rf /home/nacos-server-${NACOS_VERSION}.tar.gz /home/nacos/bin/* /home/nacos/conf/*.properties /home/nacos/conf/*.example /home/nacos/conf/nacos-mysql.sql
|
|
|
|
RUN yum autoremove -y wget \
|
2020-06-19 12:43:21 +00:00
|
|
|
&& ln -snf /usr/share/zoneinfo/$TIME_ZONE /etc/localtime && echo $TIME_ZONE > /etc/timezone \
|
2019-05-22 08:18:41 +00:00
|
|
|
&& yum clean all
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ADD bin/docker-startup.sh bin/docker-startup.sh
|
|
|
|
ADD conf/application.properties conf/application.properties
|
|
|
|
ADD init.d/custom.properties init.d/custom.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
|
2019-11-21 03:08:51 +00:00
|
|
|
ENTRYPOINT ["bin/docker-startup.sh"]
|