Compare commits
8 Commits
Author | SHA1 | Date |
---|---|---|
|
1d6a782209 | |
|
15e18cee5b | |
|
162d5648da | |
|
cd6bbed07b | |
|
125bd1bbf0 | |
|
ec4c5deffd | |
|
ee0314881c | |
|
6a606eecda |
|
@ -42,7 +42,8 @@ jobs:
|
|||
uses: docker/metadata-action@v3
|
||||
with:
|
||||
images: nacos/nacos-server
|
||||
|
||||
flavor: |
|
||||
latest=false
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v2.3.0
|
||||
with:
|
||||
|
@ -51,4 +52,51 @@ jobs:
|
|||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: ${{steps.version_step.outputs.version}}
|
||||
build-args: ${{steps.version_step.outputs.version}}
|
||||
|
||||
push_to_multi_platforms_registry:
|
||||
name: Push Docker slim image to Docker Hub
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Extract Version
|
||||
id: version_step
|
||||
run: |
|
||||
echo "##[set-output name=version;]NACOS_VERSION=${GITHUB_REF#$"refs/tags/v"}"
|
||||
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v3
|
||||
with:
|
||||
images: nacos/nacos-server
|
||||
flavor: |
|
||||
latest=false
|
||||
tags: |
|
||||
type=pep440,pattern=v{{version}}-slim
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v2.3.0
|
||||
with:
|
||||
context: build
|
||||
platforms: linux/amd64,linux/arm64
|
||||
file: build/Dockerfile.Slim
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: ${{steps.version_step.outputs.version}}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
FROM centos:7.5.1804
|
||||
MAINTAINER pader "huangmnlove@163.com"
|
||||
FROM centos:7.9.2009
|
||||
LABEL maintainer="pader <huangmnlove@163.com>"
|
||||
|
||||
# set environment
|
||||
ENV MODE="cluster" \
|
||||
|
@ -20,20 +20,19 @@ ENV MODE="cluster" \
|
|||
TOMCAT_ACCESSLOG_ENABLED="false" \
|
||||
TIME_ZONE="Asia/Shanghai"
|
||||
|
||||
ARG NACOS_VERSION=2.0.4
|
||||
ARG NACOS_VERSION=1.4.7
|
||||
ARG HOT_FIX_FLAG=""
|
||||
|
||||
WORKDIR $BASE_DIR
|
||||
|
||||
RUN set -x \
|
||||
&& yum update -y \
|
||||
&& yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel wget iputils nc vim libcurl
|
||||
RUN wget https://github.com/alibaba/nacos/releases/download/${NACOS_VERSION}${HOT_FIX_FLAG}/nacos-server-${NACOS_VERSION}.tar.gz -P /home
|
||||
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 \
|
||||
&& ln -snf /usr/share/zoneinfo/$TIME_ZONE /etc/localtime && echo $TIME_ZONE > /etc/timezone \
|
||||
&& yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel iputils nc vim libcurl \
|
||||
&& yum clean all
|
||||
RUN curl -SL https://github.com/alibaba/nacos/releases/download/${NACOS_VERSION}${HOT_FIX_FLAG}/nacos-server-${NACOS_VERSION}.tar.gz -o /home/nacos-server.tar.gz \
|
||||
&& tar -xzvf /home/nacos-server.tar.gz -C /home \
|
||||
&& rm -rf /home/nacos-server.tar.gz /home/nacos/bin/* /home/nacos/conf/*.properties /home/nacos/conf/*.example /home/nacos/conf/nacos-mysql.sql \
|
||||
&& ln -snf /usr/share/zoneinfo/$TIME_ZONE /etc/localtime && echo $TIME_ZONE > /etc/timezone
|
||||
|
||||
|
||||
|
||||
|
@ -44,8 +43,7 @@ ADD conf/application.properties conf/application.properties
|
|||
|
||||
# set startup log dir
|
||||
RUN mkdir -p logs \
|
||||
&& cd logs \
|
||||
&& touch start.out \
|
||||
&& touch logs/start.out \
|
||||
&& ln -sf /dev/stdout start.out \
|
||||
&& ln -sf /dev/stderr start.out
|
||||
RUN chmod +x bin/docker-startup.sh
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
FROM amd64/buildpack-deps:buster-curl as installer
|
||||
|
||||
ARG NACOS_VERSION=2.0.4
|
||||
ARG NACOS_VERSION=1.4.7
|
||||
ARG HOT_FIX_FLAG=""
|
||||
|
||||
RUN set -x \
|
||||
|
@ -8,7 +8,7 @@ RUN set -x \
|
|||
&& 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
|
||||
|
||||
FROM openjdk:8-jre-slim
|
||||
FROM adoptopenjdk/openjdk8:jre8u372-b07
|
||||
|
||||
# set environment
|
||||
ENV MODE="cluster" \
|
||||
|
@ -18,7 +18,7 @@ ENV MODE="cluster" \
|
|||
CLUSTER_CONF="/home/nacos/conf/cluster.conf" \
|
||||
FUNCTION_MODE="all" \
|
||||
NACOS_USER="nacos" \
|
||||
JAVA="/usr/local/openjdk-8/bin/java" \
|
||||
JAVA="/opt/java/openjdk/bin/java" \
|
||||
JVM_XMS="1g" \
|
||||
JVM_XMX="1g" \
|
||||
JVM_XMN="512m" \
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
set -x
|
||||
export CUSTOM_SEARCH_NAMES="application,custom"
|
||||
export CUSTOM_SEARCH_LOCATIONS=${BASE_DIR}/init.d/,file:${BASE_DIR}/conf/
|
||||
export CUSTOM_SEARCH_NAMES="application"
|
||||
export CUSTOM_SEARCH_LOCATIONS=file:${BASE_DIR}/conf/
|
||||
export MEMBER_LIST=""
|
||||
PLUGINS_DIR="/home/nacos/plugins/peer-finder"
|
||||
function print_servers() {
|
||||
|
@ -30,6 +30,7 @@ function print_servers() {
|
|||
#===========================================================================================
|
||||
# JVM Configuration
|
||||
#===========================================================================================
|
||||
JAVA_OPT="${JAVA_OPT} -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+CMSClassUnloadingEnabled -XX:SurvivorRatio=8 -XX:-UseParNewGC"
|
||||
if [[ "${MODE}" == "standalone" ]]; then
|
||||
|
||||
JAVA_OPT="${JAVA_OPT} -Xms${JVM_XMS} -Xmx${JVM_XMX} -Xmn${JVM_XMN}"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# spring
|
||||
server.servlet.contextPath=${SERVER_SERVLET_CONTEXTPATH:/nacos}
|
||||
server.contextPath=/nacos
|
||||
server.error.include-message=ALWAYS
|
||||
server.port=${NACOS_APPLICATION_PORT:8848}
|
||||
spring.datasource.platform=${SPRING_DATASOURCE_PLATFORM:""}
|
||||
nacos.cmdb.dumpTaskInterval=3600
|
||||
|
@ -20,17 +21,17 @@ nacos.core.auth.system.type=${NACOS_AUTH_SYSTEM_TYPE:nacos}
|
|||
nacos.core.auth.default.token.expire.seconds=${NACOS_AUTH_TOKEN_EXPIRE_SECONDS:18000}
|
||||
|
||||
### The default token:
|
||||
nacos.core.auth.default.token.secret.key=${NACOS_AUTH_TOKEN:SecretKey012345678901234567890123456789012345678901234567890123456789}
|
||||
nacos.core.auth.default.token.secret.key=${NACOS_AUTH_TOKEN:}
|
||||
|
||||
### Turn on/off caching of auth information. By turning on this switch, the update of auth information would have a 15 seconds delay.
|
||||
nacos.core.auth.caching.enabled=${NACOS_AUTH_CACHE_ENABLE:false}
|
||||
nacos.core.auth.enable.userAgentAuthWhite=${NACOS_AUTH_USER_AGENT_AUTH_WHITE_ENABLE:false}
|
||||
nacos.core.auth.server.identity.key=${NACOS_AUTH_IDENTITY_KEY:serverIdentity}
|
||||
nacos.core.auth.server.identity.value=${NACOS_AUTH_IDENTITY_VALUE:security}
|
||||
nacos.core.auth.server.identity.key=${NACOS_AUTH_IDENTITY_KEY:}
|
||||
nacos.core.auth.server.identity.value=${NACOS_AUTH_IDENTITY_VALUE:}
|
||||
server.tomcat.accesslog.enabled=${TOMCAT_ACCESSLOG_ENABLED:false}
|
||||
server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D
|
||||
# default current work dir
|
||||
server.tomcat.basedir=
|
||||
server.tomcat.basedir=file:.
|
||||
## spring security config
|
||||
### turn off security
|
||||
nacos.security.ignore.urls=${NACOS_SECURITY_IGNORE_URLS:/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**}
|
||||
|
|
|
@ -5,4 +5,8 @@ MYSQL_SERVICE_HOST=mysql
|
|||
MYSQL_SERVICE_DB_NAME=nacos_devtest
|
||||
MYSQL_SERVICE_PORT=3306
|
||||
MYSQL_SERVICE_USER=nacos
|
||||
MYSQL_SERVICE_PASSWORD=nacos
|
||||
MYSQL_SERVICE_PASSWORD=nacos
|
||||
MYSQL_SERVICE_DB_PARAM=characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
|
||||
NACOS_AUTH_IDENTITY_KEY=2222
|
||||
NACOS_AUTH_IDENTITY_VALUE=2xxx
|
||||
NACOS_AUTH_TOKEN=SecretKey012345678901234567890123456789012345678901234567890123456789
|
||||
|
|
|
@ -4,4 +4,8 @@ MYSQL_SERVICE_HOST=mysql
|
|||
MYSQL_SERVICE_DB_NAME=nacos_devtest
|
||||
MYSQL_SERVICE_PORT=3306
|
||||
MYSQL_SERVICE_USER=nacos
|
||||
MYSQL_SERVICE_PASSWORD=nacos
|
||||
MYSQL_SERVICE_PASSWORD=nacos
|
||||
MYSQL_SERVICE_DB_PARAM=characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
|
||||
NACOS_AUTH_IDENTITY_KEY=2222
|
||||
NACOS_AUTH_IDENTITY_VALUE=2xxx
|
||||
NACOS_AUTH_TOKEN=SecretKey012345678901234567890123456789012345678901234567890123456789
|
||||
|
|
|
@ -6,4 +6,7 @@ MYSQL_SERVICE_DB_NAME=nacos_devtest
|
|||
MYSQL_SERVICE_PORT=3306
|
||||
MYSQL_SERVICE_USER=nacos
|
||||
MYSQL_SERVICE_PASSWORD=nacos
|
||||
MYSQL_SERVICE_DB_PARAM=characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useSSL=false
|
||||
MYSQL_SERVICE_DB_PARAM=characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
|
||||
NACOS_AUTH_IDENTITY_KEY=2222
|
||||
NACOS_AUTH_IDENTITY_VALUE=2xxx
|
||||
NACOS_AUTH_TOKEN=SecretKey012345678901234567890123456789012345678901234567890123456789
|
||||
|
|
|
@ -1 +1 @@
|
|||
NACOS_VERSION=v2.0.4
|
||||
NACOS_VERSION=v1.4.6
|
||||
|
|
Loading…
Reference in New Issue