update
This commit is contained in:
14
alpine/Dockerfile-3.23
Normal file
14
alpine/Dockerfile-3.23
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
FROM alpine:3.23
|
||||||
|
MAINTAINER Colben colbenlee@gmail.com
|
||||||
|
ADD --chown=root:root /ADD/ /etc/
|
||||||
|
RUN echo -e 'https://mirrors.nju.edu.cn/alpine/v3.23/main\n\
|
||||||
|
https://mirrors.nju.edu.cn/alpine/v3.23/community\n\
|
||||||
|
' > /etc/apk/repositories \
|
||||||
|
&& apk update \
|
||||||
|
&& apk add --no-cache bash curl coreutils iproute2 \
|
||||||
|
&& echo "alias ls='ls --color=auto'" >> /root/.bashrc \
|
||||||
|
&& rm -rf /var/cache/apk/*
|
||||||
|
ENV PS1='\[\e[33;1;1m\][\[\e[0m\]\[\e[35;1m\]\u\[\e[0m\]\[\e[33;1;1m\]@\[\e[0m\]\[\e[31;1;1m\]docker\[\e[0m\]\[\e[32;1;1m\](\h)\[\e[0m\]\[\e[33;1;1m\]:\[\e[0m\]\[\e[32m\]\w\[\e[0m\]\[\e[33;1;1m\]]\[\e[0m\]\[\e[36m\]\$\[\e[0m\] '
|
||||||
|
ENV PS2='\[\e[36m\]>\[\e[0m\] '
|
||||||
|
ENV LANG=en_US.UTF-8
|
||||||
|
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
ARG ARCH
|
ARG ARCH
|
||||||
FROM harbor.colben.cn/general/alpine$ARCH:3.20
|
FROM harbor.colben.cn/general/alpine$ARCH:3.23
|
||||||
MAINTAINER Colben colbenlee@gmail.com
|
MAINTAINER Colben colbenlee@gmail.com
|
||||||
ADD --chown=root:root /ADD/ /opt/
|
ADD --chown=root:root /ADD/ /opt/
|
||||||
RUN apk update \
|
RUN sed -i 's/v3.23/edge/' /etc/apk/repositories \
|
||||||
|
&& apk update \
|
||||||
&& apk add --no-cache nginx nginx-mod-stream \
|
&& apk add --no-cache nginx nginx-mod-stream \
|
||||||
&& sed -i \
|
&& sed -i \
|
||||||
-e '1a\\n# Added by Dockerfile' \
|
-e '1a\\n# Added by Dockerfile' \
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export LANG=en_US.UTF-8
|
|||||||
|
|
||||||
[ 'x86_64' == "$(uname -m)" ] && ARCH='' || ARCH="-$(uname -m)"
|
[ 'x86_64' == "$(uname -m)" ] && ARCH='' || ARCH="-$(uname -m)"
|
||||||
ROOT_DIR="$(cd $(dirname $0) && pwd)"
|
ROOT_DIR="$(cd $(dirname $0) && pwd)"
|
||||||
TAG=$1
|
TAG=${1:-latest}
|
||||||
IMAGE="harbor.colben.cn/general/$(basename ${0%.sh})$ARCH:$TAG"
|
IMAGE="harbor.colben.cn/general/$(basename ${0%.sh})$ARCH:$TAG"
|
||||||
|
|
||||||
if [ -t 0 ]; then
|
if [ -t 0 ]; then
|
||||||
|
|||||||
@@ -58,6 +58,8 @@ function ModifyConf {
|
|||||||
protected-mode no
|
protected-mode no
|
||||||
maxmemory 6442450944
|
maxmemory 6442450944
|
||||||
maxmemory-policy volatile-random
|
maxmemory-policy volatile-random
|
||||||
|
timeout 300
|
||||||
|
maxclients 8192
|
||||||
" > /etc/redis.conf
|
" > /etc/redis.conf
|
||||||
while read kv; do
|
while read kv; do
|
||||||
[ 'cluster-enabled=yes' == "$kv" ] && clusterEnabled=1
|
[ 'cluster-enabled=yes' == "$kv" ] && clusterEnabled=1
|
||||||
@@ -73,21 +75,20 @@ function DeployCluster {
|
|||||||
local i=
|
local i=
|
||||||
local node=
|
local node=
|
||||||
local nodesId=
|
local nodesId=
|
||||||
local clusterEnabled=
|
local clusterInfo=
|
||||||
local redisCliCmd="redis-cli ${REQUIREPASS:+-a $REQUIREPASS --no-auth-warning}"
|
local redisCliCmd="redis-cli ${REQUIREPASS:+-a $REQUIREPASS --no-auth-warning}"
|
||||||
[ 0 -ne ${#SLAVE_NODES[@]} -a ${#SLAVE_NODES[@]} -ne ${#MASTER_NODES[@]} ] \
|
[ 0 -ne ${#SLAVE_NODES[@]} -a ${#SLAVE_NODES[@]} -ne ${#MASTER_NODES[@]} ] \
|
||||||
&& Print The num of slave nodes not equal to the num of master nodes! \
|
&& Print The num of slave nodes not equal to the num of master nodes! \
|
||||||
&& exit 100
|
&& exit 100
|
||||||
|
Print Checking the state of all nodes ...
|
||||||
for node in ${MASTER_NODES[@]} ${SLAVE_NODES[@]}; do
|
for node in ${MASTER_NODES[@]} ${SLAVE_NODES[@]}; do
|
||||||
for i in {0..5}; do
|
for i in {0..5}; do
|
||||||
[ 5 -eq $i ] \
|
[ 5 -eq $i ] \
|
||||||
&& Print Failed to connect to $node! \
|
&& Print Failed to connect to $node! \
|
||||||
&& exit 100
|
&& exit 100
|
||||||
sleep 6
|
sleep 2
|
||||||
clusterEnabled=$($redisCliCmd --raw -d , -h ${node/:/ -p } \
|
clusterInfo=$($redisCliCmd -h ${node/:/ -p } info cluster) || continue
|
||||||
CONFIG GET cluster-enabled) \
|
echo "$clusterInfo" | grep -q cluster_enabled:1 && break
|
||||||
|| continue
|
|
||||||
[[ "$clusterEnabled" =~ ,yes$ ]] && break
|
|
||||||
Print $node not enable cluster mode! && exit 100
|
Print $node not enable cluster mode! && exit 100
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|||||||
10
redis/Dockerfile-5
Normal file
10
redis/Dockerfile-5
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
ARG ARCH
|
||||||
|
FROM harbor.colben.cn/general/alpine$ARCH:3.23
|
||||||
|
MAINTAINER Colben colbenlee@gmail.com
|
||||||
|
ADD --chown=root:root /ADD/ /opt/
|
||||||
|
RUN curl -sSLO https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.12/main/$(uname -m)/redis-5.0.14-r0.apk \
|
||||||
|
&& apk add --allow-untrusted redis-5.0.14-r0.apk \
|
||||||
|
&& mv /etc/redis.conf /etc/redis.conf.origin \
|
||||||
|
&& rm -rf /var/cache/apk/* redis-5.0.14-r0.apk
|
||||||
|
CMD ["/opt/ccmd"]
|
||||||
|
|
||||||
@@ -2,8 +2,7 @@ ARG ARCH
|
|||||||
FROM harbor.colben.cn/general/alpine$ARCH:3.20
|
FROM harbor.colben.cn/general/alpine$ARCH:3.20
|
||||||
MAINTAINER Colben colbenlee@gmail.com
|
MAINTAINER Colben colbenlee@gmail.com
|
||||||
ADD --chown=root:root /ADD/ /opt/
|
ADD --chown=root:root /ADD/ /opt/
|
||||||
RUN apk update \
|
RUN curl -sSLO https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.15/main/$(uname -m)/redis-6.2.18-r0.apk \
|
||||||
&& curl -sSLO https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.15/main/$(uname -m)/redis-6.2.18-r0.apk \
|
|
||||||
&& apk add --allow-untrusted redis-6.2.18-r0.apk \
|
&& apk add --allow-untrusted redis-6.2.18-r0.apk \
|
||||||
&& mv /etc/redis.conf /etc/redis.conf.origin \
|
&& mv /etc/redis.conf /etc/redis.conf.origin \
|
||||||
&& rm -rf /var/cache/apk/* redis-6.2.18-r0.apk
|
&& rm -rf /var/cache/apk/* redis-6.2.18-r0.apk
|
||||||
@@ -9,7 +9,8 @@ export LANG=en_US.UTF-8
|
|||||||
|
|
||||||
[ 'x86_64' == "$(uname -m)" ] && ARCH='' || ARCH="-$(uname -m)"
|
[ 'x86_64' == "$(uname -m)" ] && ARCH='' || ARCH="-$(uname -m)"
|
||||||
ROOT_DIR="$(cd $(dirname $0) && pwd)"
|
ROOT_DIR="$(cd $(dirname $0) && pwd)"
|
||||||
IMAGE="harbor.colben.cn/general/$(basename ${0%.sh})$ARCH:latest"
|
TAG=$1
|
||||||
|
IMAGE="harbor.colben.cn/general/$(basename ${0%.sh})$ARCH:$TAG"
|
||||||
|
|
||||||
if [ -t 0 ]; then
|
if [ -t 0 ]; then
|
||||||
function Print { echo -e "\033[36;1m$(date +'[%F %T]')\033[32;1m $*\033[0m"; }
|
function Print { echo -e "\033[36;1m$(date +'[%F %T]')\033[32;1m $*\033[0m"; }
|
||||||
@@ -51,7 +52,7 @@ function Build {
|
|||||||
&& Warn Removing image $IMAGE ... \
|
&& Warn Removing image $IMAGE ... \
|
||||||
&& docker rmi $IMAGE
|
&& docker rmi $IMAGE
|
||||||
Warn Building image: $IMAGE ...
|
Warn Building image: $IMAGE ...
|
||||||
docker build --force-rm --build-arg ARCH="$ARCH" -t $IMAGE .
|
docker build --force-rm --build-arg ARCH="$ARCH" -t $IMAGE -f Dockerfile-$TAG .
|
||||||
YesOrNo Push image: $IMAGE? && docker push $IMAGE
|
YesOrNo Push image: $IMAGE? && docker push $IMAGE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user