diff --git a/image/proxy-tengine3/.dockerignore b/image/proxy-tengine3/.dockerignore new file mode 100644 index 0000000..f3487e9 --- /dev/null +++ b/image/proxy-tengine3/.dockerignore @@ -0,0 +1,5 @@ +# 由 build.sh 预下载的 tengine 源码包经 ADD 解压进镜像, +# ADD 的源文件必须在构建上下文内,因此 *.tar.gz 不能在这里忽略 +build.sh +.git/ +.DS_Store diff --git a/image/proxy-tengine3/.gitignore b/image/proxy-tengine3/.gitignore new file mode 100644 index 0000000..9a1bb28 --- /dev/null +++ b/image/proxy-tengine3/.gitignore @@ -0,0 +1,3 @@ +# 构建产物 / 本地缓存 +*.tar.gz +.DS_Store diff --git a/image/proxy-tengine3/Dockerfile b/image/proxy-tengine3/Dockerfile index f324b34..c446a2d 100644 --- a/image/proxy-tengine3/Dockerfile +++ b/image/proxy-tengine3/Dockerfile @@ -8,7 +8,9 @@ WORKDIR /home/admin # 使用自定义配置覆盖默认可映射的目录:conf/nginx.conf、conf/conf.d、conf/ssl COPY nginx.conf ${NGINX_HOME}/conf/nginx.conf # https://tengine.taobao.org/download/tengine-3.1.0.tar.gz -ADD https://tengine.taobao.org/download/tengine-${TENGINE_VERSION}.tar.gz ./ +# 由 build.sh 预先下载到本目录 +ADD tengine-${TENGINE_VERSION}.tar.gz ./ +# gcc/gcc-c++/make 用于编译 tengine;sysstat/net-tools 用于排障 RUN yum install \ gcc \ gcc-c++ \ diff --git a/image/proxy-tengine3/build.sh b/image/proxy-tengine3/build.sh index 6e6089f..1e5e2e4 100755 --- a/image/proxy-tengine3/build.sh +++ b/image/proxy-tengine3/build.sh @@ -1,3 +1,15 @@ +#!/usr/bin/env bash +# 先下载 tengine 源码包到当前目录,再基于本地文件构建镜像 +set -euo pipefail +cd "$(dirname "$0")" + +TENGINE=tengine-3.1.0.tar.gz +URL=https://tengine.taobao.org/download/tengine-3.1.0.tar.gz + +if [ ! -f "${TENGINE}" ]; then + curl -fL -o "${TENGINE}" "${URL}" +fi + IMAGE=registry.cn-shanghai.aliyuncs.com/odboy/kenaito:proxy-tengine3 docker build -t "${IMAGE}" . docker push "${IMAGE}" diff --git a/image/runtime-python3/.dockerignore b/image/runtime-python3/.dockerignore new file mode 100644 index 0000000..0499fef --- /dev/null +++ b/image/runtime-python3/.dockerignore @@ -0,0 +1,5 @@ +# 由 build.sh 预下载的 Python 源码包经 ADD 解压进镜像, +# ADD 的源文件必须在构建上下文内,因此 *.tgz 不能在这里忽略 +build.sh +.git/ +.DS_Store diff --git a/image/runtime-python3/.gitignore b/image/runtime-python3/.gitignore new file mode 100644 index 0000000..c1f73c5 --- /dev/null +++ b/image/runtime-python3/.gitignore @@ -0,0 +1,3 @@ +# 构建产物 / 本地缓存 +*.tgz +.DS_Store diff --git a/image/runtime-python3/Dockerfile b/image/runtime-python3/Dockerfile index 3ffbfc3..a982cec 100644 --- a/image/runtime-python3/Dockerfile +++ b/image/runtime-python3/Dockerfile @@ -4,7 +4,9 @@ ENV TimeZone=Asia/Shanghai ENV PYTHON_HOME=/usr/local/python3 ENV PATH="${PYTHON_HOME}/bin:$PATH" WORKDIR /home/admin -ADD https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz ./ +# https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz +# 由 build.sh 预先下载到本目录 +ADD Python-3.10.0.tgz ./ RUN yum install \ libffi-devel \ zlib-devel \ diff --git a/image/runtime-python3/build.sh b/image/runtime-python3/build.sh old mode 100644 new mode 100755 index bdfb524..e0af636 --- a/image/runtime-python3/build.sh +++ b/image/runtime-python3/build.sh @@ -1,3 +1,15 @@ +#!/usr/bin/env bash +# 先下载 Python 源码包到当前目录,再基于本地文件构建镜像 +set -euo pipefail +cd "$(dirname "$0")" + +PYTHON=Python-3.10.0.tgz +URL=https://www.python.org/ftp/python/3.10.0/${PYTHON} + +if [ ! -f "${PYTHON}" ]; then + curl -fL -o "${PYTHON}" "${URL}" +fi + IMAGE=registry.cn-shanghai.aliyuncs.com/odboy/kenaito:runtime-python3 docker build -t "${IMAGE}" . docker push "${IMAGE}" diff --git a/image/tools-ansible/.dockerignore b/image/tools-ansible/.dockerignore new file mode 100644 index 0000000..0499fef --- /dev/null +++ b/image/tools-ansible/.dockerignore @@ -0,0 +1,5 @@ +# 由 build.sh 预下载的 Python 源码包经 ADD 解压进镜像, +# ADD 的源文件必须在构建上下文内,因此 *.tgz 不能在这里忽略 +build.sh +.git/ +.DS_Store diff --git a/image/tools-ansible/.gitignore b/image/tools-ansible/.gitignore new file mode 100644 index 0000000..c1f73c5 --- /dev/null +++ b/image/tools-ansible/.gitignore @@ -0,0 +1,3 @@ +# 构建产物 / 本地缓存 +*.tgz +.DS_Store diff --git a/image/tools-ansible/Dockerfile b/image/tools-ansible/Dockerfile index dae7e8a..226ea8f 100644 --- a/image/tools-ansible/Dockerfile +++ b/image/tools-ansible/Dockerfile @@ -4,7 +4,9 @@ ENV TimeZone=Asia/Shanghai ENV PYTHON_HOME=/usr/local/python3 ENV PATH="${PYTHON_HOME}/bin:$PATH" WORKDIR /home/admin -ADD https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz ./ +# https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz +# 由 build.sh 预先下载到本目录 +ADD Python-3.10.0.tgz ./ RUN yum install \ libffi-devel \ zlib-devel \ diff --git a/image/tools-ansible/build.sh b/image/tools-ansible/build.sh old mode 100644 new mode 100755 index 61a199e..d366446 --- a/image/tools-ansible/build.sh +++ b/image/tools-ansible/build.sh @@ -1,3 +1,15 @@ +#!/usr/bin/env bash +# 先下载 Python 源码包到当前目录,再基于本地文件构建镜像 +set -euo pipefail +cd "$(dirname "$0")" + +PYTHON=Python-3.10.0.tgz +URL=https://www.python.org/ftp/python/3.10.0/${PYTHON} + +if [ ! -f "${PYTHON}" ]; then + curl -fL -o "${PYTHON}" "${URL}" +fi + IMAGE=registry.cn-shanghai.aliyuncs.com/odboy/kenaito:tools-ansible docker build -t "${IMAGE}" . docker push "${IMAGE}"