Dockerfile 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. FROM centos:7.5.1804
  2. MAINTAINER pader "huangmnlove@163.com"
  3. # set environment
  4. ENV MODE="cluster" \
  5. PREFER_HOST_MODE="ip"\
  6. BASE_DIR="/home/nacos" \
  7. CLASSPATH=".:/home/nacos/conf:$CLASSPATH" \
  8. CLUSTER_CONF="/home/nacos/conf/cluster.conf" \
  9. FUNCTION_MODE="all" \
  10. JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk" \
  11. NACOS_USER="nacos" \
  12. JAVA="/usr/lib/jvm/java-1.8.0-openjdk/bin/java" \
  13. JVM_XMS="2g" \
  14. JVM_XMX="2g" \
  15. JVM_XMN="1g" \
  16. JVM_MS="128m" \
  17. JVM_MMS="320m" \
  18. NACOS_DEBUG="n" \
  19. TOMCAT_ACCESSLOG_ENABLED="false" \
  20. TIME_ZONE="Asia/Shanghai"
  21. ARG NACOS_VERSION=1.3.2
  22. WORKDIR /$BASE_DIR
  23. RUN set -x \
  24. && yum update -y \
  25. && yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel wget iputils nc vim libcurl
  26. RUN wget https://github.com/alibaba/nacos/releases/download/${NACOS_VERSION}/nacos-server-${NACOS_VERSION}.tar.gz -P /home
  27. RUN tar -xzvf /home/nacos-server-${NACOS_VERSION}.tar.gz -C /home \
  28. && 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
  29. RUN yum autoremove -y wget \
  30. && ln -snf /usr/share/zoneinfo/$TIME_ZONE /etc/localtime && echo $TIME_ZONE > /etc/timezone \
  31. && yum clean all
  32. ADD bin/docker-startup.sh bin/docker-startup.sh
  33. ADD conf/application.properties conf/application.properties
  34. ADD init.d/custom.properties init.d/custom.properties
  35. # set startup log dir
  36. RUN mkdir -p logs \
  37. && cd logs \
  38. && touch start.out \
  39. && ln -sf /dev/stdout start.out \
  40. && ln -sf /dev/stderr start.out
  41. RUN chmod +x bin/docker-startup.sh
  42. EXPOSE 8848
  43. ENTRYPOINT ["bin/docker-startup.sh"]