ChilliCream / graphql-platform

Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
https://chillicream.com
MIT License
5.19k stars 739 forks source link

dotnet restore fails while using Docker with Strawberry Shake v13 #5995

Closed dillonm197 closed 7 months ago

dillonm197 commented 1 year ago

Is there an existing issue for this?

Product

Strawberry Shake

Describe the bug

dotnet restore fails for my project when attempting to build via Docker after migrating from Strawberry Shake v12 to v13.

OS: ubuntu-20.04

Steps to reproduce

  1. Create a new dotnet WebApi application
    • dotnet 7
    • StrawberryShake.Server v13.0.5
  2. Create and run dockerfile:
    
    FROM mcr.microsoft.com/dotnet/sdk:7.0 AS start-env

FROM start-env AS copy-env WORKDIR /restore

RUN mkdir /restore-directory

RUN --mount=type=bind,target=. \ find . ( -name ".csproj" -o -name ".sln" -o -name "NuGet.Config" -o -name "*.sql" ) \ -exec cp -p --parents '{}' /restore-directory \;

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS restore-env WORKDIR /app

COPY --from=copy-env /restore-directory/ /app/

RUN dotnet restore --no-cache -nowarn:NU1701 \ --use-lock-file \ MyProject/MyProject.csproj \ && dotnet build -nowarn:NU1701 \ --no-restore --nologo -nowarn:NU1701 \ MyProject/MyProject.csproj

...


### Relevant log output

```shell
#19 44.99 MSBUILD : warning MSB5029: The value "\**\*.cs" of the "Include" attribute in element <ItemGroup> in file "/root/.nuget/packages/strawberryshake.server/13.0.5/build/StrawberryShake.Server.targets (23,16)" is a wildcard that results in enumerating all files on the drive, which was likely not intended. Check that referenced properties are always defined. [/app/MyProject/MyProject.csproj]
#19 44.99 CSC : error CS2021: File name '/**/*.cs' is empty, contains invalid characters, has a drive specification without an absolute path, or is too long [/app/MyProject/MyProject.csproj]
#19 44.99 CSC : error CS2001: Source file '/**/*.cs' could not be found. [/app/MyProject/MyProject.csproj]

Additional Context?

No response

Version

13.0.5

glen-84 commented 8 months ago

@dillonm197

Are you able to reproduce this issue with Strawberry Shake 13.8.1?

I'm not able to reproduce with 13.8.1 and a simplified Dockerfile:

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
WORKDIR /App

# Copy everything
COPY . ./
# Restore as distinct layers
RUN dotnet restore
# Build and publish a release
RUN dotnet publish -c Release -o out

# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:7.0
WORKDIR /App
COPY --from=build-env /App/out .
ENTRYPOINT ["dotnet", "hc-5995.dll"]
glen-84 commented 7 months ago

Closing, as no response has been received from the author.