GoogleCloudPlatform / GoogleCloudPlatform/cloud-builders

[FR] Honouring dockerignore files outside of build context root

Open
#1,006 0 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
Go
Stars
1.5k
Forks
616
PR merge metrics
No merged PRs in 30d

Description

## Notice

**To request a feature in the hosted Google Cloud Build service, please contact your Google Cloud Support representative or suggest your feature using [Google's public issue tracker](https://issuetracker.google.com/issues/new?component=190802&template=1162743).**

This GitHub issue tracker is intended for feature requests in the officially supported builder images __only__. This issue tracker is __not__ the right place to request features like triggers or notifications.

If you're not sure where to suggest your feature, use [Google's public issue tracker](https://issuetracker.google.com/issues/new?component=190802&template=1162743).

## Detailed Feature Information

**Which builder is relevant to this request?**
docker

**Is your feature request related to a problem? Please describe.**
Docker docs describes how to name dockerignore files which are not in the build context root. Instead of a `./.dockerignore` file you can have `.dockerignore` alongside `` (with `-f ` used in the build command). This works locally (MacOS) using Docker version 27.0.3, build 7d4bcd8 on Docker Desktop 4.32.0 (157355). However, in a gcloud build only the `./.dockerignore` in the build context root seems to be supported.

**Describe the solution you'd like**
Support for dockerignore files outside of the build context root as specified in the Docker build documentation
https://docs.docker.com/build/building/context/#filename-and-location
https://docs.docker.com/build/dockerfile/release-notes/#bug-fixes-and-enhancements-18

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.