Skip to content

Dockerfile COPY with multiple sources needs trailing slash #286

@joebowbeer

Description

@joebowbeer

There are 7 instances in Dockerfiles in this repo:

https://github.com/search?q=repo%3Arestatedev%2Fexamples+Dockerfile+package*.json&type=code

Expected:

COPY package*.json ./

Actual:

COPY package*.json .

The requirement is:

https://docs.docker.com/reference/dockerfile/#source-1

If you specify multiple source files, either directly or using a wildcard, then the destination must be a directory (must end with a slash /).

There is no package-lock.json in these template folders, but anyone using these templates is likely to be bitten by this as soon as npm install generates a package-lock.json.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions