Commit 5dcb2fba authored by xiaojun207's avatar xiaojun207
Browse files

优化部分脚本,升级版本

parent e99510d1
...@@ -6,11 +6,12 @@ LABEL maintainer="xiaojun207 <xiaojun207@126.com>" ...@@ -6,11 +6,12 @@ LABEL maintainer="xiaojun207 <xiaojun207@126.com>"
RUN set -ex \ RUN set -ex \
&& apk upgrade --update-cache --available \ && apk upgrade --update-cache --available \
&& apk add bash openssl git \ && apk add bash openssl git \
&& git clone https://github.com/neilpang/acme.sh.git acme_src \ && git clone https://github.com/acmesh-official/acme.sh.git acme_src \
&& cd /acme_src && ./acme.sh --install --cert-home /acme_cert \ && cd /acme_src && ./acme.sh --install --cert-home /acme_cert \
&& apk del git \ && apk del git \
&& rm -rf /acme_src /var/cache/apk/* \ && rm -rf /acme_src /var/cache/apk/* \
&& mkdir -p /etc/nginx/ssl/ && mkdir -p /etc/nginx/ssl/ \
&& alias acme.sh=~/.acme.sh/acme.sh
COPY ./nginx.conf /etc/nginx/nginx.conf COPY ./nginx.conf /etc/nginx/nginx.conf
COPY ./default.conf /etc/nginx/conf.d/default.conf COPY ./default.conf /etc/nginx/conf.d/default.conf
......
...@@ -6,7 +6,7 @@ IMAGE=xiaojun207/nginx ...@@ -6,7 +6,7 @@ IMAGE=xiaojun207/nginx
# 版本信息来自nginx官方镜像 # 版本信息来自nginx官方镜像
# https://hub.docker.com/_/nginx?tab=tags # https://hub.docker.com/_/nginx?tab=tags
NGINX_VERSIONS=( NGINX_VERSIONS=(
1.23.0 1.25.3
) )
function build() { function build() {
...@@ -23,8 +23,8 @@ function build() { ...@@ -23,8 +23,8 @@ function build() {
TAG_LATEST="${MAJOR}.${MINOR}" TAG_LATEST="${MAJOR}.${MINOR}"
TAG_SPECIAL="${MAJOR}.${MINOR}.${PATCH}" TAG_SPECIAL="${MAJOR}.${MINOR}.${PATCH}"
docker buildx build \ # --platform linux/amd64,linux/arm64 \
--platform linux/amd64,linux/arm64 \ docker build \
--build-arg NGINX_VERSION="$NGINX_VERSION" \ --build-arg NGINX_VERSION="$NGINX_VERSION" \
--tag $IMAGE:"latest" \ --tag $IMAGE:"latest" \
--tag $IMAGE:"$TAG_LATEST" \ --tag $IMAGE:"$TAG_LATEST" \
......
...@@ -64,13 +64,13 @@ function StartAcmesh() { ...@@ -64,13 +64,13 @@ function StartAcmesh() {
/root/.acme.sh/acme.sh --set-default-ca --server $SslServer /root/.acme.sh/acme.sh --set-default-ca --server $SslServer
fi fi
echo "[$(date)] acme.sh register .." echo "[$(date)] 1、acme.sh register .."
/root/.acme.sh/acme.sh --register-account -m $mail /root/.acme.sh/acme.sh --register-account -m $mail
echo "[$(date)] acme.sh issue .." echo "[$(date)] 2、acme.sh issue .."
/root/.acme.sh/acme.sh --issue --nginx $ACME_DOMAIN_OPTION --renew-hook "${RELOAD_CMD}" /root/.acme.sh/acme.sh --issue --nginx $ACME_DOMAIN_OPTION --renew-hook "${RELOAD_CMD}"
echo "[$(date)] acme.sh install-cert .." echo "[$(date)] 3、acme.sh install-cert .."
/root/.acme.sh/acme.sh --install-cert $ACME_DOMAIN_OPTION \ /root/.acme.sh/acme.sh --install-cert $ACME_DOMAIN_OPTION \
--fullchain-file ${SSL_DIR}/fullchain.pem \ --fullchain-file ${SSL_DIR}/fullchain.pem \
--cert-file "${SSL_DIR}/cert.pem" \ --cert-file "${SSL_DIR}/cert.pem" \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment