```docker_image( name="book-creator", sour...
# general
c
Copy code
docker_image(
    name="book-creator",
    source="Dockerfile",
    dependencies=[
        "src/services/utils:util_files",
        ":service_files",
        "//:root",
        "//:git"
    ]
)
but this does not copy the .git folder
e
Not 100% sure, but I expect the issue here is that you didn't actually glob the files in the git folder. Try running
pants list ./.git/::
and I expect it will be empty. Change your sources field to
sources=["./.git/**/*"]
and try the
pants list
command again. If its still empty, then this may be due to
.gitignore
by default, pants ignores files that are .gitignored. One of the settings to change this is https://www.pantsbuild.org/prerelease/reference/global-options#pants_ignore_use_gitignore
h
Yeah, git state is completely ignored by Pants by default.
c
but then how do i copy the
.git
folder into my docker build stage? Because i need that for building the image
h
What are you actually trying to do? It seems odd to need local
.git
state inside a container
But if you really want to you can, as @elegant-florist-94385 suggested, turn off
use_gitignore
So pants doesn’t ignore it