GoogleCloudPlatform / cloud-builders

Builder images and examples commonly used for Google Cloud Build
https://cloud.google.com/cloud-build/
Apache License 2.0
1.38k stars 590 forks source link

[FR] Honouring dockerignore files outside of build context root #1006

Open ollie-bell opened 3 months ago

ollie-bell commented 3 months ago

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.

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.

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 <path/to/Dockerfile>.dockerignore alongside <path/to/Dockerfile> (with -f </path/to/Dockerfile> 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.

drmdanowar commented 1 month ago

THANKS