fix: jdk11/17/21 打包改为不写入 macOS 扩展属性;新增 python315 镜像目录

jdk 镜像 ADD 解包报 lsetxattr ... xattr "com.apple.provenance": no such file
or directory:macOS 的 BSD tar 会把 xattr 编码成 AppleDouble(./._*)条目写进
tar 内,BuildKit 解包 AppleDouble 时失败。xattr -rc 不可行(JDK 内 legal/*
为 0444 无权限清除,且清掉后会被 macOS 重新打上),故改为
COPYFILE_DISABLE=1 tar --no-xattrs --no-acls 打包。

- jdk11/17/21:去掉无效的 xattr -rc,打包命令加 COPYFILE_DISABLE=1
- jdk11/17/21:下载的原包 SRC_PKG 保留在本地复用,不再删除
- 新增 image/runtime-python315 镜像目录
This commit is contained in:
2026-02-28 21:38:00 +08:00
parent 2961bdb48b
commit 5b55262a28
8 changed files with 91 additions and 9 deletions
+5
View File
@@ -0,0 +1,5 @@
# 由 build.sh 预下载的 Python 源码包经 ADD 解压进镜像,
# ADD 的源文件必须在构建上下文内,因此 *.tgz 不能在这里忽略
build.sh
.git/
.DS_Store
+3
View File
@@ -0,0 +1,3 @@
# 构建产物 / 本地缓存
*.tgz
.DS_Store
+30
View File
@@ -0,0 +1,30 @@
FROM registry.cn-shanghai.aliyuncs.com/odboy/kenaito:system-alinux3
LABEL MAINTAINER="tianjun@odboy.cn"
ENV TimeZone=Asia/Shanghai
ENV PYTHON_HOME=/usr/local/python3
ENV PATH="${PYTHON_HOME}/bin:$PATH"
WORKDIR /home/admin
# https://www.python.org/ftp/python/3.15.2/Python-3.15.2.tgz
# 由 build.sh 预先下载到本目录
ADD Python-3.15.2.tgz ./
RUN set -e && yum install \
libffi-devel \
zlib-devel \
bzip2-devel \
openssl-devel \
ncurses-devel \
sqlite-devel \
readline-devel \
xz-devel \
make \
gcc \
tar \
sysstat \
net-tools -y; \
cd Python-3.15.2; \
./configure --prefix=/usr/local/python3; \
make && make install; \
python3 -V; \
cd /home/admin && rm -rf Python-3.15.2; \
mkdir ~/.pip;
COPY pip.conf ~/.pip/
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
# 先下载 Python 源码包到当前目录,再基于本地文件构建镜像
set -euo pipefail
cd "$(dirname "$0")"
PYTHON=Python-3.15.2.tgz
URL=https://www.python.org/ftp/python/3.15.2/${PYTHON}
if [ ! -f "${PYTHON}" ]; then
curl -fL -o "${PYTHON}" "${URL}"
fi
IMAGE=registry.cn-shanghai.aliyuncs.com/odboy/kenaito:runtime-python315
docker build -t "${IMAGE}" .
docker push "${IMAGE}"
+5
View File
@@ -0,0 +1,5 @@
[global]
index-url = https://mirrors.aliyun.com/pypi/simple
[install]
trusted-host = mirrors.aliyun.com