Skip to content

Add dockerignore to clean up final image#384

Open
lpmi-13 wants to merge 4 commits intoRaspberryPiFoundation:mainfrom
lpmi-13:add-dockerignore
Open

Add dockerignore to clean up final image#384
lpmi-13 wants to merge 4 commits intoRaspberryPiFoundation:mainfrom
lpmi-13:add-dockerignore

Conversation

@lpmi-13
Copy link

@lpmi-13 lpmi-13 commented Jul 11, 2024

Points for consideration:

Currently, the final base image has a bunch of things it doesn't need, including the entire .git folder.

This commit adds a .dockerignore to keep the things we don't need out of the final image.

What's changed?

  • fewer unneeded files in the final built image

Currently, the final base image has a bunch of things it doesn't need, including the entire .git folder.

This commit adds a .dockerignore to keep the things we don't need out of the final image.
@cla-bot
Copy link

cla-bot bot commented Jul 11, 2024

We require contributors to sign our Contributor License Agreement, and we don't have you on file. In order for us to review and merge your code, please complete this form and we'll get you added and review your contribution as soon as possible.

@lpmi-13
Copy link
Author

lpmi-13 commented Jul 11, 2024

tried to submit the CLA form twice, but maybe it just takes a while to sync 🤷

@adrian-rpf adrian-rpf requested review from a team and removed request for a team January 14, 2026 10:21
@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Feb 14, 2026
@adrian-rpf
Copy link
Contributor

I'm investigating this issue. Not stale

@adrian-rpf adrian-rpf removed the Stale label Feb 20, 2026
@adrian-rpf adrian-rpf self-assigned this Feb 20, 2026
@adrian-rpf adrian-rpf self-requested a review February 20, 2026 17:36
Reorganise and expand .dockerignore entries to exclude CI, Docker config, editor/devtooling files, docs, environment samples, tests, and runtime directories.
Reduces Docker build context size and prevents including unnecessary or sensitive files (e.g. .env.example, log, tmp, storage, .devcontainer, Dockerfile, docker-compose files, .DS_Store, rubocop config, docs, spec)
Copilot AI review requested due to automatic review settings February 26, 2026 18:06
@cla-bot cla-bot bot added the cla-signed label Feb 26, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a .dockerignore file to reduce the size of the Docker image by excluding unnecessary files from the build context. The application is a Rails application that uses a multi-stage Docker build, and this change ensures that development files, version control data, and other non-runtime assets are excluded from the final image.

Changes:

  • Added comprehensive .dockerignore file that excludes version control files (.git), CI/CD configuration, development tooling, tests, and documentation while preserving all runtime-required files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

The Dockerfile copies .tool-versions during the builder stage, so excluding it in .dockerignore causes the image build to fail with a missing file error. This keeps the ignore list lean while preserving a successful app image build.

Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants