惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
有赞技术团队
有赞技术团队
IT之家
IT之家
博客园 - 聂微东
Jina AI
Jina AI
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
Apple Machine Learning Research
Apple Machine Learning Research
WordPress大学
WordPress大学
小众软件
小众软件
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Visual Studio Blog
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
阮一峰的网络日志
阮一峰的网络日志
宝玉的分享
宝玉的分享
博客园 - 三生石上(FineUI控件)
大猫的无限游戏
大猫的无限游戏
博客园 - Franky
量子位
月光博客
月光博客
博客园 - 【当耐特】
博客园 - 叶小钗

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(docker): replace curl|bash Bun install with pinned mu...
fede-kamel · 2026-05-02 · via Recent Commits to openclaw:main

@@ -33,43 +33,67 @@ type DependabotConfig = {

3333

updates?: DependabotUpdate[];

3434

};

353536-

function resolveFirstFromReference(dockerfile: string): string | undefined {

36+

function resolveArgDefaults(dockerfile: string): Map<string, string> {

3737

const argDefaults = new Map<string, string>();

38-3938

for (const line of dockerfile.split(/\r?\n/)) {

4039

const trimmed = line.trim();

41-

if (!trimmed) {

42-

continue;

43-

}

44-

if (trimmed.startsWith("FROM ")) {

45-

break;

46-

}

4740

const argMatch = trimmed.match(/^ARG\s+([A-Z0-9_]+)=(.+)$/);

4841

if (!argMatch) {

4942

continue;

5043

}

5144

const [, name, rawValue] = argMatch;

52-

const value = rawValue.replace(/^["']|["']$/g, "");

53-

argDefaults.set(name, value);

54-

}

55-56-

const fromLine = dockerfile.split(/\r?\n/).find((line) => line.trimStart().startsWith("FROM "));

57-

if (!fromLine) {

58-

return undefined;

45+

argDefaults.set(name, rawValue.replace(/^["']|["']$/g, ""));

5946

}

47+

return argDefaults;

48+

}

604950+

function resolveFromImageRef(fromLine: string, argDefaults: Map<string, string>): string {

6151

const fromMatch = fromLine.trim().match(/^FROM\s+(\S+?)(?:\s+AS\s+\S+)?$/);

6252

if (!fromMatch) {

63-

return undefined;

53+

return fromLine;

6454

}

6555

const imageRef = fromMatch[1];

6656

const argName =

6757

imageRef.match(/^\$\{([A-Z0-9_]+)\}$/)?.[1] ?? imageRef.match(/^\$([A-Z0-9_]+)$/)?.[1];

68-6958

if (!argName) {

7059

return imageRef;

7160

}

72-

return argDefaults.get(argName);

61+

return argDefaults.get(argName) ?? imageRef;

62+

}

63+64+

function resolveAllArgBackedFromReferences(

65+

dockerfile: string,

66+

): { stage: string; imageRef: string }[] {

67+

const argDefaults = resolveArgDefaults(dockerfile);

68+

const results: { stage: string; imageRef: string }[] = [];

69+

let stageIndex = 0;

70+

for (const line of dockerfile.split(/\r?\n/)) {

71+

const trimmed = line.trim();

72+

if (!trimmed.startsWith("FROM ")) {

73+

continue;

74+

}

75+

const imageRef = resolveFromImageRef(trimmed, argDefaults);

76+

// Only check FROM lines that use an ARG — literal `FROM scratch` etc. are intentionally unpinned.

77+

const usesArg =

78+

trimmed.match(/FROM\s+\$\{[A-Z0-9_]+\}/) !== null ||

79+

trimmed.match(/FROM\s+\$[A-Z0-9_]+/) !== null;

80+

if (usesArg) {

81+

const stageMatch = trimmed.match(/AS\s+(\S+)/i);

82+

const stageName = stageMatch ? stageMatch[1] : `stage-${stageIndex}`;

83+

results.push({ stage: stageName, imageRef });

84+

}

85+

stageIndex += 1;

86+

}

87+

return results;

88+

}

89+90+

function resolveFirstFromReference(dockerfile: string): string | undefined {

91+

const argDefaults = resolveArgDefaults(dockerfile);

92+

const fromLine = dockerfile.split(/\r?\n/).find((line) => line.trimStart().startsWith("FROM "));

93+

if (!fromLine) {

94+

return undefined;

95+

}

96+

return resolveFromImageRef(fromLine, argDefaults);

7397

}

74987599

describe("docker base image pinning", () => {

@@ -84,6 +108,18 @@ describe("docker base image pinning", () => {

84108

}

85109

});

86110111+

it("pins all ARG-backed FROM stages in selected Dockerfiles to sha256 digests", async () => {

112+

for (const dockerfilePath of DIGEST_PINNED_DOCKERFILES) {

113+

const dockerfile = await readFile(resolve(repoRoot, dockerfilePath), "utf8");

114+

const stages = resolveAllArgBackedFromReferences(dockerfile);

115+

for (const { stage, imageRef } of stages) {

116+

expect(imageRef, `${dockerfilePath} stage "${stage}" must be digest-pinned`).toMatch(

117+

/^\S+@sha256:[a-f0-9]{64}$/,

118+

);

119+

}

120+

}

121+

});

122+87123

it("keeps Dependabot Docker updates enabled for root Dockerfiles", async () => {

88124

const raw = await readFile(resolve(repoRoot, ".github/dependabot.yml"), "utf8");

89125

const config = parse(raw) as DependabotConfig;