Skip to content

Issue: .env file being included in Docker image despite .dockerignore #1

@KojoShaddy

Description

@KojoShaddy

My Google Cloud environment uses a different set of credentials from my local setup. However, when I run the deployment process, my local .env file is still being packaged into the Docker image.

This is unexpected because .env is already listed in my .dockerignore, but it appears to still be copied during the build.

Expected behaviour
The .env file should be excluded from the Docker build context and not included in the final image.

Actual behaviour
The .env file is included in the built image, potentially exposing local credentials.

Question
What could cause .dockerignore to be ignored in this case, and how can I ensure the .env file is fully excluded from the image during build/deploy?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions