Retry sing-box downloads in runtime builds
Build and Deploy Gateway / build-and-push (push) Successful in 36s
Build and Deploy Gateway / deploy (push) Successful in 18s

This commit is contained in:
2026-08-09 13:33:28 +03:00
parent d612e227fa
commit 3204ecf4a5
5 changed files with 14 additions and 5 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ RUN if [ "${INSTALL_SINGBOX}" = "true" ]; then \
arm64) sb_arch="arm64" ;; \ arm64) sb_arch="arm64" ;; \
*) echo "Unsupported architecture: $arch" >&2; exit 1 ;; \ *) echo "Unsupported architecture: $arch" >&2; exit 1 ;; \
esac; \ esac; \
curl -fsSL "https://github.com/SagerNet/sing-box/releases/download/v${SINGBOX_VERSION}/sing-box-${SINGBOX_VERSION}-linux-${sb_arch}.tar.gz" -o /tmp/sing-box.tgz; \ curl --retry 5 --retry-all-errors --retry-delay 2 -fsSL "https://github.com/SagerNet/sing-box/releases/download/v${SINGBOX_VERSION}/sing-box-${SINGBOX_VERSION}-linux-${sb_arch}.tar.gz" -o /tmp/sing-box.tgz; \
tar -xzf /tmp/sing-box.tgz -C /tmp; \ tar -xzf /tmp/sing-box.tgz -C /tmp; \
mv "/tmp/sing-box-${SINGBOX_VERSION}-linux-${sb_arch}/sing-box" /usr/local/bin/sing-box; \ mv "/tmp/sing-box-${SINGBOX_VERSION}-linux-${sb_arch}/sing-box" /usr/local/bin/sing-box; \
chmod +x /usr/local/bin/sing-box; \ chmod +x /usr/local/bin/sing-box; \
+1 -1
View File
@@ -26,7 +26,7 @@ RUN set -eux; \
arm64) sb_arch="arm64" ;; \ arm64) sb_arch="arm64" ;; \
*) echo "Unsupported architecture: $arch" >&2; exit 1 ;; \ *) echo "Unsupported architecture: $arch" >&2; exit 1 ;; \
esac; \ esac; \
curl -fsSL "https://github.com/SagerNet/sing-box/releases/download/v${SINGBOX_VERSION}/sing-box-${SINGBOX_VERSION}-linux-${sb_arch}.tar.gz" -o /tmp/sing-box.tgz; \ curl --retry 5 --retry-all-errors --retry-delay 2 -fsSL "https://github.com/SagerNet/sing-box/releases/download/v${SINGBOX_VERSION}/sing-box-${SINGBOX_VERSION}-linux-${sb_arch}.tar.gz" -o /tmp/sing-box.tgz; \
tar -xzf /tmp/sing-box.tgz -C /tmp; \ tar -xzf /tmp/sing-box.tgz -C /tmp; \
mv "/tmp/sing-box-${SINGBOX_VERSION}-linux-${sb_arch}/sing-box" /usr/local/bin/sing-box; \ mv "/tmp/sing-box-${SINGBOX_VERSION}-linux-${sb_arch}/sing-box" /usr/local/bin/sing-box; \
chmod +x /usr/local/bin/sing-box; \ chmod +x /usr/local/bin/sing-box; \
+1 -1
View File
@@ -45,7 +45,7 @@ RUN set -eux; \
arm64) sb_arch="arm64" ;; \ arm64) sb_arch="arm64" ;; \
*) echo "Unsupported architecture: $arch" >&2; exit 1 ;; \ *) echo "Unsupported architecture: $arch" >&2; exit 1 ;; \
esac; \ esac; \
curl -fsSL "https://github.com/SagerNet/sing-box/releases/download/v${SINGBOX_VERSION}/sing-box-${SINGBOX_VERSION}-linux-${sb_arch}.tar.gz" -o /tmp/sing-box.tgz; \ curl --retry 5 --retry-all-errors --retry-delay 2 -fsSL "https://github.com/SagerNet/sing-box/releases/download/v${SINGBOX_VERSION}/sing-box-${SINGBOX_VERSION}-linux-${sb_arch}.tar.gz" -o /tmp/sing-box.tgz; \
tar -xzf /tmp/sing-box.tgz -C /tmp; \ tar -xzf /tmp/sing-box.tgz -C /tmp; \
mv "/tmp/sing-box-${SINGBOX_VERSION}-linux-${sb_arch}/sing-box" /usr/local/bin/sing-box; \ mv "/tmp/sing-box-${SINGBOX_VERSION}-linux-${sb_arch}/sing-box" /usr/local/bin/sing-box; \
chmod +x /usr/local/bin/sing-box; \ chmod +x /usr/local/bin/sing-box; \
+2 -2
View File
@@ -1,7 +1,7 @@
export const HARBOR_VERSIONS = Object.freeze({ export const HARBOR_VERSIONS = Object.freeze({
macClient: '0.21.4', macClient: '0.21.5',
gatewayClient: '0.22.0', gatewayClient: '0.22.0',
gatewayBackend: '0.22.4', gatewayBackend: '0.22.5',
}); });
export interface ParsedVersion { export interface ParsedVersion {
+9
View File
@@ -170,3 +170,12 @@ test('every shipped build defaults to sing-box 1.13.18', () => {
assert.match(fs.readFileSync(path.join(root, file), 'utf8'), /SINGBOX_VERSION[^\n]*1\.13\.18/); assert.match(fs.readFileSync(path.join(root, file), 'utf8'), /SINGBOX_VERSION[^\n]*1\.13\.18/);
} }
}); });
test('runtime builds retry transient sing-box release download failures', () => {
for (const file of ['Dockerfile', 'Dockerfile.client', 'Dockerfile.runtime-base']) {
assert.match(
fs.readFileSync(path.join(root, file), 'utf8'),
/curl --retry 5 --retry-all-errors --retry-delay 2 -fsSL .*SagerNet\/sing-box/,
);
}
});