Skip to content

Renovate doesn't handle single-quoted empty value for Dockerfile's ARG #44497

Description

@RahulGautamSingh

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIssues that first-time contributors to Renovate may find more comfortablemanager:dockerfileDockerfile files

    Type

    Fields

    Priority

    Medium

    Regression introduced in

    None yet

    Datasource

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions