fix: Update Docker daemon configuration to improve image caching and reduce concurrent downloads
Build and Deploy / build (push) Failing after 4s

This commit is contained in:
masoodafar-web
2026-01-27 23:08:46 +03:30
parent 828109f44d
commit 273ae390c5
+12 -15
View File
@@ -34,26 +34,23 @@ jobs:
mkdir -p /etc/docker
cat > /etc/docker/daemon.json << 'DAEMON'
{
"insecure-registries": ["194.5.195.53:30080", "gitea-svc:3000"]
"insecure-registries": ["194.5.195.53:30080", "gitea-svc:3000"],
"registry-mirrors": [],
"max-concurrent-downloads": 3,
"max-concurrent-uploads": 5
}
DAEMON
mkdir -p ~/.docker
cat > ~/.docker/config.json << 'CONF'
{
"proxies": {
"default": {
"httpProxy": "http://proxyuser:87zH26nbqT2@46.249.98.211:3128",
"httpsProxy": "http://proxyuser:87zH26nbqT2@46.249.98.211:3128",
"noProxy": "localhost,127.0.0.1,gitea-svc,194.5.195.53,10.0.0.0/8"
}
}
}
CONF
# بدون proxy - از cached images استفاده می‌شود
dockerd &
for i in $(seq 1 30); do
docker info >/dev/null 2>&1 && break || sleep 2
done
docker info
# بررسی وجود cached images
echo "📊 Checking cached base images..."
docker images | grep mcr.microsoft.com || echo "⚠️ Base images not cached"
- name: Checkout code
run: |
@@ -63,11 +60,11 @@ jobs:
- name: Build Docker Image
run: |
cd src
# استفاده از cached base images (بدون دانلود)
docker build -f BackOffice.BFF.WebApi/Dockerfile \
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} \
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \
--build-arg HTTP_PROXY=http://proxyuser:87zH26nbqT2@46.249.98.211:3128 \
--build-arg HTTPS_PROXY=http://proxyuser:87zH26nbqT2@46.249.98.211:3128 \
--pull=never \
.