Skip to content

Stop copying unneccesary files/folders during the building stage #1968

@nabokihms

Description

@nabokihms

Is your feature request related to a problem?

COPY . . in the Dockefile is always a tricky thing. It copies more than dex needs, which leads to unwanted behavior.

  1. Dockerfile: Changing anything makes rebuilding the dex.
  2. .git/: Actually, dex needs git for building to extract version (and other things). However, any new branch, tag, or commit invalidates the downward layers of a docker image.
  3. examples/: I think the idea is clear.
  4. *.md: ...

Describe the solution you'd like to see

  • Add files/folders to .dockerignore (including .git folder).
  • Do all git operations outside of the docker context and then send calculated values to docker build via args.

Describe alternatives you've considered

As an alternative, it is possible to migrate to another building tool, e.g., scaffold, bazel, werf, whatever. It looks like an overcomplication, though.

Additional context

Solving problems with unnecessary rebuilds will help us with caching layers in the future.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions