使用 vfs 构建嵌套容器镜像
test / python (pull_request) Successful in 9s
test / shell (pull_request) Successful in 20s

This commit is contained in:
2026-09-16 18:16:41 +00:00
parent 893323a89b
commit 38946e8def
+7 -5
View File
@@ -45,7 +45,12 @@ jobs:
shell: bash shell: bash
run: | run: |
set -euo pipefail set -euo pipefail
dockerd >/tmp/dockerd.log 2>&1 & # The runner Pod itself uses an overlay filesystem. A nested overlay
# snapshotter cannot mount there, so use the copy-based vfs driver.
dockerd \
--storage-driver=vfs \
--feature containerd-snapshotter=false \
>/tmp/dockerd.log 2>&1 &
for _ in $(seq 1 60); do for _ in $(seq 1 60); do
if docker info >/dev/null 2>&1; then if docker info >/dev/null 2>&1; then
exit 0 exit 0
@@ -71,7 +76,6 @@ jobs:
jwt_file=$(mktemp) jwt_file=$(mktemp)
cleanup() { cleanup() {
rm -rf -- "$docker_config" "$jwt_file" rm -rf -- "$docker_config" "$jwt_file"
docker buildx rm ci-builder >/dev/null 2>&1 || true
} }
trap cleanup EXIT trap cleanup EXIT
export DOCKER_CONFIG="$docker_config" export DOCKER_CONFIG="$docker_config"
@@ -84,14 +88,12 @@ jobs:
jq -er '.[0].svids[0].svid' "$jwt_file" | \ jq -er '.[0].svids[0].svid' "$jwt_file" | \
docker login "$PUSH_REGISTRY" --username zot --password-stdin docker login "$PUSH_REGISTRY" --username zot --password-stdin
docker buildx create --name ci-builder --driver docker-container --use
publish() { publish() {
local repository=$1 local repository=$1
local dockerfile=$2 local dockerfile=$2
local metadata=$3 local metadata=$3
docker buildx build \ docker buildx build \
--builder ci-builder \ --builder default \
--platform linux/amd64 \ --platform linux/amd64 \
--file "$dockerfile" \ --file "$dockerfile" \
--tag "${PUSH_REGISTRY}/${repository}:${image_tag}" \ --tag "${PUSH_REGISTRY}/${repository}:${image_tag}" \