Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux Docker build fails due to .NET 6 #29

Closed
nmcglo opened this issue Apr 16, 2022 · 1 comment
Closed

Linux Docker build fails due to .NET 6 #29

nmcglo opened this issue Apr 16, 2022 · 1 comment

Comments

@nmcglo
Copy link
Contributor

nmcglo commented Apr 16, 2022

The Dockerfile in the current master branch uses a .NET SDK 5.0 base image which can't target .NET 6 targets.

Relevant output for docker build -t pgstosrt .

Step 4/9 : RUN cd /src &&     dotnet restore  &&     dotnet publish -c Release -o /src/PgsToSrt/out &&     mv /src/entrypoint.sh /entrypoint.sh && chmod +x /entrypoint.sh &&     mv /src/PgsToSrt/out /app
 ---> Running in 94e0c48afbe5
  Determining projects to restore...
/usr/share/dotnet/sdk/5.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(141,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 6.0.  Either target .NET Core 5.0 or lower, or use a version of the .NET SDK that supports .NET Core 6.0. [/src/PgsToSrt/PgsToSrt.csproj]
The command '/bin/sh -c cd /src &&     dotnet restore  &&     dotnet publish -c Release -o /src/PgsToSrt/out &&     mv /src/entrypoint.sh /entrypoint.sh && chmod +x /entrypoint.sh &&     mv /src/PgsToSrt/out /app' returned a non-zero code: 1

Steps to reproduce:

git clone https://github.com/Tentacule/PgsToSrt.git
cd PgsToSrt

# checkout the latest release v1.4.2 or master at 38fd03e57f
git checkout v1.4.2

docker build -t pgstosrt .

Quick fix:

Change the .NET SDK base image to 6.0
Specify the framework to target net6.0 (because the project specifies both 5.0 or 6.0 as potential targets, one must be explicitly chosen)

Alternatively, leave the .NET SDK base image to 5.0.101
Specify the framework to target net5.0

@nmcglo
Copy link
Contributor Author

nmcglo commented Apr 16, 2022

This is also addressed in #28, hadn't seen that before I submitted #30 🤦‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants