Skip to content

Exclude gitfile from docker image#1246

Merged
takanabe merged 1 commit intomainfrom
tw-ignore-git-files
Feb 26, 2026
Merged

Exclude gitfile from docker image#1246
takanabe merged 1 commit intomainfrom
tw-ignore-git-files

Conversation

@takanabe
Copy link
Contributor

@takanabe takanabe commented Feb 20, 2026

We found git files are included in Docker images but I don't think we need them in the image. Could you confirm if they are not necessary?

Probably, it is better to include necessary files only rather than adding ignored files to dockerignore but I'm not familir with the code base now. So, let me do this approach for now.

@takanabe takanabe requested review from Konboi and ono-max February 20, 2026 17:50
@takanabe takanabe force-pushed the tw-ignore-git-files branch from ea587bc to 37c03e6 Compare February 20, 2026 17:51
@@ -0,0 +1,4 @@
# Git files
.git
Copy link
Contributor

Choose a reason for hiding this comment

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

We're installing git in our Dockerfile. Do you think that it has a negative impact if we exclude gitfile?

Copy link
Contributor

Choose a reason for hiding this comment

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

If my understanding is correct, this Git that you mentioned command is required when users record a commit or perform a build.
However, the .git directory (which contains the smart-tests history) is not necessary for building smart-tests, so it is excluded.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay. Cool.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for your explanation.

@@ -0,0 +1,4 @@
# Git files
.git
Copy link
Contributor

Choose a reason for hiding this comment

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

If my understanding is correct, this Git that you mentioned command is required when users record a commit or perform a build.
However, the .git directory (which contains the smart-tests history) is not necessary for building smart-tests, so it is excluded.

@takanabe takanabe merged commit 74dde1f into main Feb 26, 2026
2 checks passed
@takanabe takanabe deleted the tw-ignore-git-files branch February 26, 2026 19:58
@github-actions github-actions bot mentioned this pull request Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants