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

dotnet.runtimeconfig.json is empty when docker build executed #259

Open
daumast opened this issue Oct 3, 2024 · 3 comments
Open

dotnet.runtimeconfig.json is empty when docker build executed #259

daumast opened this issue Oct 3, 2024 · 3 comments
Labels
area-tutorials Issues related to getting started tutorials info-provided tutorial-microservices Microservices tutorial related issues

Comments

@daumast
Copy link

daumast commented Oct 3, 2024

URL

https://dotnet.microsoft.com/en-us/learn/aspnet/microservice-tutorial/docker-image

Operating system

Windows

More information about your system

Windows 10 Pro 22H2
x64

Description

Ran as provided by tutorial: docker build -t mymicroservice .
Got
=> ERROR [build 4/6] RUN dotnet restore

[build 4/6] RUN dotnet restore:
0.446 A JSON parsing exception occurred in [/usr/share/dotnet/sdk/8.0.402/dotnet.runtimeconfig.json], offset 0 (line 1, column 1): The document is empty.
0.446 Invalid runtimeconfig.json [/usr/share/dotnet/sdk/8.0.402/dotnet.runtimeconfig.json] [/usr/share/dotnet/sdk/8.0.402/dotnet.runtimeconfig.dev.json]

exit code: 147

dotnet --info

.NET SDK:
Version: 8.0.402
Commit: 70aa751718
Workload version: 8.0.400-manifests.251308be
MSBuild version: 17.11.4+37eb419ad

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.402\

.NET workloads installed:
Configured to use loose manifests when installing new manifests.
There are no installed workloads to display.

Host:
Version: 8.0.8
Architecture: x64
Commit: 08338fcaa5

.NET SDKs installed:
8.0.400 [C:\Program Files\dotnet\sdk]
8.0.402 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.33 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.33 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not found

@daumast daumast added area-tutorials Issues related to getting started tutorials needs-triage Issues that haven't been triaged yet labels Oct 3, 2024
@katiesavage katiesavage added needs-more-info Not enough information has been provided. Please share more detail as requested. tutorial-microservices Microservices tutorial related issues and removed needs-triage Issues that haven't been triaged yet labels Oct 4, 2024
@katiesavage
Copy link

Can you try running dotnet restore and dotnet build?

Copy link

This issue is stale because there has been no response to a request for more information for 7 days.

@github-actions github-actions bot added the stale Issue is stale. Waiting on answer. label Oct 11, 2024
@daumast
Copy link
Author

daumast commented Oct 13, 2024

Can you try running dotnet restore and dotnet build?

Sorry for being late.
So dotnet restore and dotnet build works on machine. Just can't build for docker.

Seems like something wrong in system itself since a machine is old one and some VSs, VSCs, .NETs were installed, uninstalled many times. There were no problems on laptop with only VSC installed.

Next text is about original old PC and Docker.
I tried to clean up, run the scenario and now it went this way. .NET is updated as it lived through Sep 24 patch tuesday.

--
preparation

wsl --install
docker install
restarting

delete bin, obj
dotnet run. works in http://localhost:{port}/weatherforecast

--
1st try

docker build -t mymicroservice .

on build:
Docker Desktop - WSL distro terminated abruptly
Diagnostics ID: 4DA083D8-4F6A-4065-94F9-520FC710A510/20241013095119

next: build went onto
ERROR: failed to receive status: rpc error: code = Unavailable desc = error reading from server: EOF

--
2nd try

Docker Desktop is restarted
docker build -t mymicroservice .

=> [build 5/6] COPY . . 0.1s
=> ERROR [build 6/6] RUN dotnet publish -c release -o /app 13.7s
[..]
ERROR: failed to solve: process "/bin/sh -c dotnet publish -c release -o /app" did not complete successfully: exit code: 1

View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/dy5k268htjn2g849st5m3nnxo

--
3rd try

shutting down, starting PC
cmd as administrator
docker build -t mymicroservice .

ERROR: error during connect: Head "http://%2F%2F.%2Fpipe%2FdockerDesktopLinuxEngine/_ping": open //./pipe/dockerDesktopLinuxEngine: The system cannot find the file specified.

starting Docker Desktop, engine is running

docker build -t mymicroservice .

=> CACHED [build 5/6] COPY . . 0.0s
=> ERROR [build 6/6] RUN dotnet publish -c release -o /app 12.8s

build details:
RUN dotnet publish -c release -o /app

Determining projects to restore...
All projects are up-to-date for restore.
/usr/share/dotnet/sdk/8.0.403/Current/SolutionFile/ImportAfter/Microsoft.NET.Sdk.Solution.targets(36,5): warning NETSDK1194: The "--output" option isn't supported when building a solution. Specifying a solution-level output path results in all projects copying outputs to the same directory, which can lead to inconsistent builds. [/src/MyMicroservice.sln]
MyMicroservice -> /src/bin/Release/net8.0/MyMicroservice.dll
/usr/share/dotnet/sdk/8.0.403/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.ConflictResolution.targets(112,5): error NETSDK1152: Found multiple publish output files with the same relative path: /src/MyMicroservice.runtimeconfig.json, /src/bin/Release/net8.0/MyMicroservice.runtimeconfig.json. [/src/MyMicroservice.csproj]

@github-actions github-actions bot added info-provided and removed stale Issue is stale. Waiting on answer. needs-more-info Not enough information has been provided. Please share more detail as requested. labels Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-tutorials Issues related to getting started tutorials info-provided tutorial-microservices Microservices tutorial related issues
Projects
None yet
Development

No branches or pull requests

2 participants