Discussed in #43631
Originally posted by gavvvr May 27, 2026
Description
Renovate's Dockerfile manager strips double quotes from ARG default values but not single quotes.
Docker treats ARG FOO='' and ARG FOO="" identically (both = empty string), but Renovate keeps the literal '', so a variable reference like FROM ${FOO}node:... resolves to ''node and the lookup fails.
Steps to reproduce
ARG DOCKER_HUB_MIRROR=''
ARG NODE_VERSION=21
FROM ${DOCKER_HUB_MIRROR}node:${NODE_VERSION}-alpine
Expected : '' treated as empty, image resolves to node:21-alpine
Actual : Failed to look up docker package ''node: no-result
Cause
This code block only unquotes double quotes but it should also handle single-quoted values
|
if (argMatchValue.startsWith('"') && argMatchValue.endsWith('"')) { |
|
argMatchValue = argMatchValue.slice(1, -1); |
|
} |
Fix
One-line fix plus a test case
Here is the repo: https://github.com/gavvvr/repros/tree/renovate-43631
and CI logs: https://github.com/gavvvr/repros/actions/runs/26522833187/job/78118379664#step:3:118
Discussed in #43631
Originally posted by gavvvr May 27, 2026
Description
Renovate's Dockerfile manager strips double quotes from ARG default values but not single quotes.
Docker treats
ARG FOO=''andARG FOO=""identically (both = empty string), but Renovate keeps the literal'', so a variable reference likeFROM ${FOO}node:... resolves to''nodeand the lookup fails.Steps to reproduce
Expected :
''treated as empty, image resolves tonode:21-alpineActual : Failed to look up docker package ''node: no-result
Cause
This code block only unquotes double quotes but it should also handle single-quoted values
renovate/lib/modules/manager/dockerfile/extract.ts
Lines 326 to 328 in e77f3d1
Fix
One-line fix plus a test case
Here is the repo: https://github.com/gavvvr/repros/tree/renovate-43631
and CI logs: https://github.com/gavvvr/repros/actions/runs/26522833187/job/78118379664#step:3:118