Docker image failes to copy `.git` directory

I wonder what am I doing wrong, as it seems like a trivial thing - copying a git directory onto the machine but it fails at this step.
#15 CANCELED



-----

> [11/32] COPY .git ./.git:

-----



Dockerfile:13

-------------------

11 | COPY unicorn/component/package.json ./unicorn/component/package.json

12 | COPY file-upload/package.json ./file-upload/package.json

13 | >>> COPY .git ./.git

14 |

15 | ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true

-------------------

ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref ddffb5fd-75d2-46a7-a72d-fa700071e8dc::t5indqmujowf4cd2qxu4ox7cn: "/.git": not found


#15 CANCELED



-----

> [11/32] COPY .git ./.git:

-----



Dockerfile:13

-------------------

11 | COPY unicorn/component/package.json ./unicorn/component/package.json

12 | COPY file-upload/package.json ./file-upload/package.json

13 | >>> COPY .git ./.git

14 |

15 | ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true

-------------------

ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref ddffb5fd-75d2-46a7-a72d-fa700071e8dc::t5indqmujowf4cd2qxu4ox7cn: "/.git": not found


Here is the entire Docker file https://github.com/with-labs/popspace/blob/main/Dockerfile
GitHub
popspace/Dockerfile at main · with-labs/popspace
Comprehensive source for PopSpace, virtual spaces for everybody - with-labs/popspace
Solution:
it not being there is likely a good indicator that you probably don't want to copy it in
Jump to solution
6 Replies
Percy
Percy2mo ago
Project ID: ddffb5fd-75d2-46a7-a72d-fa700071e8dc
Brody
Brody2mo ago
why would you want to copy the .git directory?
IamIconLiving
IamIconLiving2mo ago
that's actually a good question, I was trying to deploy this thing and I am not much of a docker user
Solution
Brody
Brody2mo ago
it not being there is likely a good indicator that you probably don't want to copy it in
IamIconLiving
IamIconLiving2mo ago
and indeed, removing it removed the trouble.. 🙂 thank you @Brody !
Brody
Brody2mo ago
no problem!