Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

camilamacedo86
Copy link
Member

@camilamacedo86 camilamacedo86 commented Aug 24, 2025

Closes: #5046

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 24, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 24, 2025
@camilamacedo86 camilamacedo86 changed the title ✨ (go/v4): expanded .dockerignore to exclude git files, build artifacts , IDE junk, go cache, and generated manifests for cleaner, faster docker builds WIP Aug 24, 2025
@camilamacedo86 camilamacedo86 changed the title WIP 🐛 (go/v4): Fix Docker builds failing when projects don’t include apis/, controllers/, or webhooks by updating .dockerignore to allow only Go source files and module metadata Aug 24, 2025
@camilamacedo86 camilamacedo86 changed the title 🐛 (go/v4): Fix Docker builds failing when projects don’t include apis/, controllers/, or webhooks by updating .dockerignore to allow only Go source files and module metadata WIP Aug 24, 2025
@camilamacedo86 camilamacedo86 changed the title WIP 🐛 (go/v4): Fix Docker builds failing when projects don’t include apis/, controllers/, or webhooks by updating .dockerignore to allow only Go source files and module metadata Aug 24, 2025
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
# Ignore build and test binaries.
bin/
# Ignore everything
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe adjust the comment here from # Ignore everything to something like # Ignore everything by default, re-include only needed files to better reflect what the file is doing.

Copy link
Contributor

@aman4433 aman4433 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks solid and fixes the bug as intended. 👍

…ontrollers/, or webhooks by updating .dockerignore to allow only Go source files and module metadata

The make docker-build command no longer fails for new projects that don't yet have api/ or internal/ directories.

What changed:

- The Dockerfile now uses a general COPY . . command.
- The .dockerignore file has been updated to filter the build context, ensuring only necessary files are included.
@nerdeveloper
Copy link
Contributor

LGTM

@camilamacedo86 camilamacedo86 added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 2, 2025
@k8s-ci-robot k8s-ci-robot merged commit c3b0973 into kubernetes-sigs:master Sep 2, 2025
35 checks passed
@camilamacedo86 camilamacedo86 deleted the improve-dockerignore branch September 3, 2025 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

make docker-build fails if Dockerfile has COPY api/ api/ or COPY internal/ internal/ but the dirs don’t exist.
4 participants