[PR #868] [CLOSED] fix failed to solve: source can't be a git ref for COPY #1275

Closed
opened 2025-11-09 10:09:36 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/imputnet/cobalt/pull/868
Author: @Ice-Hazymoon
Created: 10/28/2024
Status: Closed

Base: mainHead: main


📝 Commits (1)

📊 Changes

1 file changed (+4 additions, -2 deletions)

View changed files

📝 Dockerfile (+4 -2)

📄 Description

[+] Building 1.5s (2/2) FINISHED                                                                                                                                                                    
 => [internal] load build definition from Dockerfile                                                                                                                                           0.8s
 => => transferring dockerfile: 561B                                                                                                                                                           0.8s
 => [internal] load metadata for docker.io/library/node:20-bullseye-slim                                                                                                                       0.4s
==> Building image
==> Building image with Depot
--> build:  (​)
[+] Building 1.3s (2/2) FINISHED                                                                                                                                                                    
 => [internal] load build definition from Dockerfile                                                                                                                                           0.8s
 => => transferring dockerfile: 561B                                                                                                                                                           0.8s
 => [internal] load metadata for docker.io/library/node:20-bullseye-slim                                                                                                                       0.3s
Error: failed to fetch an image or build from source: error building: failed to solve: source can't be a git ref for COPY

When I run docker build, I get a strange error: failed to solve: source can't be a git ref for COPY. This error only disappears if I specify exact directories or files within the .git folder.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/imputnet/cobalt/pull/868 **Author:** [@Ice-Hazymoon](https://github.com/Ice-Hazymoon) **Created:** 10/28/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`327eebc`](https://github.com/imputnet/cobalt/commit/327eebcf3f410ca5d4c52fa8af91172cec6cf022) Update Dockerfile ### 📊 Changes **1 file changed** (+4 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `Dockerfile` (+4 -2) </details> ### 📄 Description ``` [+] Building 1.5s (2/2) FINISHED => [internal] load build definition from Dockerfile 0.8s => => transferring dockerfile: 561B 0.8s => [internal] load metadata for docker.io/library/node:20-bullseye-slim 0.4s ==> Building image ==> Building image with Depot --> build: (​) [+] Building 1.3s (2/2) FINISHED => [internal] load build definition from Dockerfile 0.8s => => transferring dockerfile: 561B 0.8s => [internal] load metadata for docker.io/library/node:20-bullseye-slim 0.3s Error: failed to fetch an image or build from source: error building: failed to solve: source can't be a git ref for COPY ``` When I run `docker build`, I get a strange error: `failed to solve: source can't be a git ref for COPY`. This error only disappears if I specify exact directories or files within the .git folder. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-09 10:09:36 -06:00
Sign in to join this conversation.