Skip to content

COPY --from command does not seem to support variables. #2155

@mdgreenwald

Description

@mdgreenwald

Expected behavior

Variable passed to COPY --from=${VARIABLE} /src /dest command would resolve.

Actual behavior

Variable is not resolved and instead generates error which indicates an invalid image name.
Service 'nginx' failed to build: invalid from flag value $name: invalid reference format

Information

  • Full output of the diagnostics from "Diagnose & Feedback" in the menu
    50A907DF-6AD6-46D8-BB63-C833ED2F502F

  • A reproducible case if this is a bug, Dockerfiles FTW

  • Page URL if this is a docs issue or the name of a man page

Steps to reproduce the behavior

  1. Copy zipped docker-compose and Dockerfile-nginx files into a folder.
  2. run the command from that folder: docker-compose build --build-arg name="image_name" nginx

Output should be: ERROR: Service 'nginx' failed to build: invalid from flag value $name: invalid reference format

dockerfiles.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions