fix(ci): build native amd64 image without buildx

This commit is contained in:
2026-08-12 15:37:36 +08:00
parent dcb6dc4429
commit ad8162f07e
3 changed files with 9 additions and 16 deletions
Vendored
+1 -15
View File
@@ -26,7 +26,6 @@ pipeline {
OPENLIST_REMOTE_DIR = '/yidongpan/构建产物/imagefind'
HTTP_PROXY_URL = 'http://192.168.5.200:7890'
NO_PROXY_HOSTS = '127.0.0.1,localhost,reg.nxsir.cn,gitea.nxsir.cn,openlist.nxsir.cn,pypi.tuna.tsinghua.edu.cn'
BUILDER_NAME = "imagefind-${BUILD_NUMBER}"
DOCKER_CONFIG = "${WORKSPACE}/.ci/docker"
NPM_CONFIG_CACHE = "${WORKSPACE}/.ci/npm-cache"
PIP_CACHE_DIR = "${WORKSPACE}/.ci/pip-cache"
@@ -130,18 +129,7 @@ pipeline {
withCredentials([usernamePassword(credentialsId: "${NODE_CREDENTIALS}", usernameVariable: 'JENKINS_NODE_USERNAME', passwordVariable: 'JENKINS_NODE_PASSWORD')]) {
sh '''
set -euo pipefail
./scripts/ci-docker.sh buildx rm -f "$BUILDER_NAME" >/dev/null 2>&1 || true
./scripts/ci-docker.sh buildx create --name "$BUILDER_NAME" --driver docker-container \
--driver-opt network=host \
--driver-opt "env.http_proxy=$HTTP_PROXY_URL" \
--driver-opt "env.https_proxy=$HTTP_PROXY_URL" \
--driver-opt "env.HTTP_PROXY=$HTTP_PROXY_URL" \
--driver-opt "env.HTTPS_PROXY=$HTTP_PROXY_URL" \
--driver-opt "env.no_proxy=reg.nxsir.cn" \
--driver-opt "env.NO_PROXY=reg.nxsir.cn" --use
./scripts/ci-docker.sh buildx inspect "$BUILDER_NAME" --bootstrap
./scripts/ci-docker.sh buildx build --builder "$BUILDER_NAME" --platform linux/amd64 --network host \
--progress=plain --provenance=false --no-cache --load \
DOCKER_BUILDKIT=0 ./scripts/ci-docker.sh build --network host --no-cache \
--build-arg HTTP_PROXY="$HTTP_PROXY_URL" --build-arg HTTPS_PROXY="$HTTP_PROXY_URL" \
--build-arg NO_PROXY="$NO_PROXY_HOSTS" -t "$IMAGE_REF" .
smoke_name="imagefind-smoke-$BUILD_NUMBER"
@@ -175,7 +163,6 @@ pipeline {
test -s .ci/docker-data/postgres-client.conf
test -e .ci/docker-data/.imagefind-admin-initialized
./scripts/ci-docker.sh rm -f "$smoke_name"
./scripts/ci-docker.sh buildx prune --builder "$BUILDER_NAME" --all --force
'''
}
}
@@ -252,7 +239,6 @@ PY
sh '''
set +e
./scripts/ci-docker.sh rm -f "imagefind-smoke-$BUILD_NUMBER" >/dev/null 2>&1 || true
./scripts/ci-docker.sh buildx rm -f "$BUILDER_NAME" >/dev/null 2>&1 || true
for tag in "$IMMUTABLE_TAG" "$APP_VERSION" latest; do ./scripts/ci-docker.sh rmi "$IMAGE_REPO:$tag" >/dev/null 2>&1 || true; done
: >"$DOCKER_CONFIG/config.json" 2>/dev/null || true
'''