Skip to content

pkg: exclude Dockerfile from COPY in all packages#5732

Draft
christoph-zededa wants to merge 1 commit intolf-edge:masterfrom
christoph-zededa:fix_dockerfile_copy
Draft

pkg: exclude Dockerfile from COPY in all packages#5732
christoph-zededa wants to merge 1 commit intolf-edge:masterfrom
christoph-zededa:fix_dockerfile_copy

Conversation

@christoph-zededa
Copy link
Copy Markdown
Contributor

Description

Use COPY --exclude=Dockerfile to prevent the Dockerfile itself from being copied into the image. Add syntax=docker/dockerfile:1.19.0 directive to Dockerfiles that lacked it to enable the --exclude flag.

This way the docker hashes bumper does not have to run several times anymore.

How to test and validate this PR

Check that the image still compiles correctly.

Changelog notes

Build improvement

PR Backports

For all current LTS branches, please state explicitly if this PR should be
backported or not. This section is used by our scripts to track the backports,
so, please, do not omit it.

Here is the list of current LTS branches (it should be always up to date):

  • 16.0-stable: no
  • 14.5-stable: no
  • 13.4-stable: no

Checklist

  • I've provided a proper description
  • I've added the proper documentation
  • I've tested my PR on amd64 device
  • I've tested my PR on arm64 device
  • I've written the test verification instructions
  • I've set the proper labels to this PR

And the last but not least:

  • I've checked the boxes above, or I've provided a good reason why I didn't
    check them.

Please, check the boxes above after submitting the PR in interactive mode.

@christoph-zededa christoph-zededa requested review from jsfakian and removed request for eriknordmark April 1, 2026 17:11
Use COPY --exclude=Dockerfile to prevent the Dockerfile itself from
being copied into the image. Add syntax=docker/dockerfile:1.19.0
directive to Dockerfiles that lacked it to enable the --exclude flag.

This way the docker hashes bumper does not have to run several times
anymore.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Christoph Ostarek <christoph@zededa.com>
@rucoder
Copy link
Copy Markdown
Contributor

rucoder commented Apr 2, 2026

@christoph-zededa why don't we use .dockerignore ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants