Skip to content

Add global ARG support for Dockerfiles #2057

@ffscl

Description

@ffscl

Feature request: Dependabot to support ARG with default values in any FROM statement when resolving dependencies.

Docker supports ARG instructions before the first FROM instruction. (https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact). The ARG instruction should be easy to parse and evaluate.

Example:

ARG REGISTRY=docker.io
FROM ${REGISTRY}/ubuntu:18.04@sha256:2695d3e10e69cc500a16eae6d6629c803c43ab075fa5ce60813a0fc49c47e859

Before checking for new versions, the FROM instruction should be evaluated as:

FROM docker.io/ubuntu:18.04@sha256:2695d3e10e69cc500a16eae6d6629c803c43ab075fa5ce60813a0fc49c47e859

Use case: Using a registry mirror that dependabot doesn't have access to. With this feature in your CI you could override the registry as follows without breaking dependabot:

docker build --build-arg REGISTRY=hub.mirror.example.com .

Metadata

Metadata

Assignees

No one assigned

    Labels

    F: language-supportIssues specific to a particular language or ecosystem; may be paired with an L: label.KeepExempt this from being marked by stalebotL: dockerDocker containersT: feature-requestRequests for new features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions