You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I Have an example project like this:
.
├── HelloClasslib
│ ├── bin
│ ├── obj
│ └── HelloClasslib.csproj
└── HelloNet8
├── bin
├── obj
├── HelloNet8.csproj
└── Dockerfile
HelloNet8 Project references Helloclasslib and i stated this in Dockerfile like this:
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref c59727a0-f1ea-462f-809f-1ea468eef3bf::ke79s2mc58qbtixh8q4lynvyz: "/Helloclasslib/Helloclasslib.csproj": not found
I think this is related to docker context. I checked the file permissions:
[helloproject] ls -l
total 12
drwxrwxr-x 4 ram ram 4096 Ara 30 20:30 Helloclasslib
drwxrwxr-x 5 ram ram 4096 Ara 30 00:27 HelloNet8
-rw-rw-r-- 1 ram ram 1591 Ara 30 20:30 helloproject.sln
[helloproject] cd Helloclasslib
[Helloclasslib] ls -l
total 16
drwxrwxr-x 3 ram ram 4096 Ara 30 20:30 bin
-rw-rw-r-- 1 ram ram 147 Ara 30 20:49 Class1.cs
-r-xr--r-- 1 ram ram 218 Ara 30 20:29 Helloclasslib.csproj
drwxrwxr-x 3 ram ram 4096 Ara 30 20:30 obj
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I Have an example project like this:
.
├── HelloClasslib
│ ├── bin
│ ├── obj
│ └── HelloClasslib.csproj
└── HelloNet8
├── bin
├── obj
├── HelloNet8.csproj
└── Dockerfile
HelloNet8 Project references Helloclasslib and i stated this in Dockerfile like this:
COPY ../HelloClasslib/HelloClasslib.csproj /app/HelloClasslib/
But when I run the
sudo docker build -t net8api-image -f Dockerfile .
command, I get this error:[+] Building 0.2s (12/12) FINISHED docker:default
=> [internal] load .dockerignore
=> => transferring context: 2B
=> [internal] load build definition from Dockerfile
=> => transferring dockerfile: 753B
=> [internal] load metadata for mcr.microsoft.com/dotnet/sdk:8.0
=> [build-env 1/6] FROM mcr.microsoft.com/dotnet/sdk:8.0
=> [internal] load build context
=> => transferring context: 3.96kB
=> CACHED [build-env 2/6] WORKDIR /app
=> CANCELED [build-env 3/6] COPY . ./
=> CACHED [build-env 4/6] RUN dotnet restore "./HelloNet8.csproj"
=> CACHED [build-env 5/6] RUN dotnet build "./HelloNet8.csproj" -c Release -o /app/build
=> CACHED [build-env 6/6] RUN dotnet publish -c Release -o out
=> CACHED [final-env 3/4] COPY --from=build-env /app/build/ .
=> ERROR [final-env 4/4] COPY ../Helloclasslib/Helloclasslib.csproj /app/Helloclasslib/
Dockerfile:25
23 | COPY --from=build-env /app/build/ .
24 |
25 | >>> COPY ../Helloclasslib/Helloclasslib.csproj /app/Helloclasslib/
26 |
27 | ENV ASPNETCORE_URLS=http://+:5073
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref c59727a0-f1ea-462f-809f-1ea468eef3bf::ke79s2mc58qbtixh8q4lynvyz: "/Helloclasslib/Helloclasslib.csproj": not found
I think this is related to docker context. I checked the file permissions:
[helloproject] ls -l
total 12
drwxrwxr-x 4 ram ram 4096 Ara 30 20:30 Helloclasslib
drwxrwxr-x 5 ram ram 4096 Ara 30 00:27 HelloNet8
-rw-rw-r-- 1 ram ram 1591 Ara 30 20:30 helloproject.sln
[helloproject] cd Helloclasslib
[Helloclasslib] ls -l
total 16
drwxrwxr-x 3 ram ram 4096 Ara 30 20:30 bin
-rw-rw-r-- 1 ram ram 147 Ara 30 20:49 Class1.cs
-r-xr--r-- 1 ram ram 218 Ara 30 20:29 Helloclasslib.csproj
drwxrwxr-x 3 ram ram 4096 Ara 30 20:30 obj
os: Ubuntu 22.04 jammy
framework: .net 8
Docker version: 24.0.7, build afdd53b
Beta Was this translation helpful? Give feedback.
All reactions