You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Exclude .env files from the image build context #312
Found in the whole-repo pre-release review for v1.0.0rc1 (finding L3).
Problem
.dockerignore is an allowlist that re-includes all of cloud_registry/, but it does not exclude .env files. A local cloud_registry/.env (or any .env.* file in an included path) would reach the build context and the build-stage layer and cache (COPY cloud_registry /tmp/src/cloud_registry). The final image is not affected (it installs only the wheel). This still breaks the org rule that every repo that builds an image excludes .env* (except .env.example) from the build context.
Fix
Append **/.env* to .dockerignore (also covers .envrc, .env-prod). Updated after review: .env.example is not re-included, since the build copies no example and a wildcard exception (!**/.env.example) makes BuildKit walk all excluded directories; a plain !cloud_registry/.env.example can be added if a build ever needs one.
Activity