microsoft / dicom-server

OSS Implementation of DICOMweb standard
MIT License
452 stars 171 forks source link

Docker build on local PC fails against commit d6cf35f - Bump HealthcareSharedPackageVersion #1369

Closed npagare closed 2 years ago

npagare commented 2 years ago

Describe the bug Local docker image building via docker compose is failing within VS 2022 (VS 17.1.0) | Win 11 Pro 64 OS Build 22557.1

To Reproduce Steps to reproduce the behavior:

  1. Update repot to the commit point - d6cf35f - Bump HealthcareSharedPackageVersion from 4.0.25 to 4.0.26 (#1365)
  2. Open Dicom API solution in VS 2022 17.0.1
  3. Update sdk version to 6.0.200 in global.json | sdk 6.2.00 was installed during VS 2022 17.0.1 upgrade
  4. In terminal run "docker build -f src/microsoft.health.dicom.web/Dockerfile -t microsoft.health.dicom.web ."

Expected behavior Docker images to be built, deployed in the local docker desktop for windows; after than relevant containers up and running

Actual behavior Docker compose fails to build the solution. See below the terminal output

docker build -f src/microsoft.health.dicom.web/Dockerfile -t microsoft.health.dicom.web . [+] Building 6.1s (13/15) => [internal] load build definition from Dockerfile 0.1s => => transferring dockerfile: 1.59kB 0.0s => [internal] load .dockerignore 0.1s => => transferring context: 483B 0.0s => [internal] load metadata for mcr.microsoft.com/dotnet/sdk:6.0.102-alpine3.14@sha256:8d15f73dcd72485cc89e59cf0fa2e97ef016c4500164dd26b71cea6d532b8134 0.0s => [internal] load metadata for mcr.microsoft.com/dotnet/aspnet:6.0.2-alpine3.14@sha256:7f9385ad945d06b35bc93b3d91a2be3e65a921ff0c872f6982b01b27088c4149 0.0s => [runtime 1/2] FROM mcr.microsoft.com/dotnet/aspnet:6.0.2-alpine3.14@sha256:7f9385ad945d06b35bc93b3d91a2be3e65a921ff0c872f6982b01b27088c4149 0.0s => [internal] load build context 5.4s => => transferring context: 33.32MB 5.4s => [build 1/5] FROM mcr.microsoft.com/dotnet/sdk:6.0.102-alpine3.14@sha256:8d15f73dcd72485cc89e59cf0fa2e97ef016c4500164dd26b71cea6d532b8134 0.0s => CACHED [runtime 2/2] RUN set -x && apk add --no-cache icu-libs && addgroup nonroot && adduser -S -D -H -s /sbin/nologin -G nonroot -g nonroot nonroot 0.0s => [dicom-server 1/2] WORKDIR /app 0.1s => CACHED [build 2/5] WORKDIR /dicom-server 0.0s => CACHED [build 3/5] COPY . . 0.0s => [build 4/5] WORKDIR /dicom-server/src/Microsoft.Health.Dicom.Web 0.1s => ERROR [build 5/5] RUN dotnet build "Microsoft.Health.Dicom.Web.csproj" -c Release -p:ContinuousIntegrationBuild=false -warnaserror 0.4s => ERROR [build 5/5] RUN dotnet build "Microsoft.Health.Dicom.Web.csproj" -c Release -p:ContinuousIntegrationBuild=false -warnaserror 0.4s

[build 5/5] RUN dotnet build "Microsoft.Health.Dicom.Web.csproj" -c Release -p:ContinuousIntegrationBuild=false -warnaserror:

13 0.336 Could not execute because the application was not found or a compatible .NET SDK is not installed.

13 0.336 Possible reasons for this include:

13 0.336 * You intended to execute a .NET program:

13 0.336 The application 'build' does not exist.

13 0.336 * You intended to execute a .NET SDK command:

13 0.336 A compatible installed .NET SDK for global.json version [6.0.200] from [/dicom-server/global.json] was not found.

13 0.336 Install the [6.0.200] .NET SDK or update [/dicom-server/global.json] with an installed .NET SDK:

13 0.336 6.0.102 [/usr/share/dotnet/sdk]


executor failed running [/bin/sh -c dotnet build "Microsoft.Health.Dicom.Web.csproj" -c $BUILD_CONFIGURATION -p:ContinuousIntegrationBuild=$CONTINUOUS_INTEGRATION_BUILD -warnaserror]: exit code: 145

npagare commented 2 years ago

I believe this error is coming from the line 15 of the src/microsoft.health.dicom.web/Dockerfile

Copy the DICOM Server project and build it

FROM mcr.microsoft.com/dotnet/sdk:6.0.102-alpine3.14@sha256:8d15f73dcd72485cc89e59cf0fa2e97ef016c4500164dd26b71cea6d532b8134 AS build

jovinson-ms commented 2 years ago

Hi @IoTFier, can you validate which .NET SDKs you have installed on your environment?

npagare commented 2 years ago

Hi @jovinson-ms - listed below as requested -

PM> dotnet --list-sdks

5.0.405 [C:\Program Files\dotnet\sdk] 6.0.200 [C:\Program Files\dotnet\sdk]

jovinson-ms commented 2 years ago

Hi @IoTFier, you're right that the image was not updated. It is updated in the latest main, and I verified that the Docker compose project builds and launches successfully from within VS 2022. However, running docker build from the terminal fails on some formatting warnings that are ignored by the repo .editorconfig file. We'll look into that issue.

npagare commented 2 years ago

Hi @jovinson-ms, how are you? Any input on the terminal error when running docker build? Thank you.

wsugarman commented 2 years ago

@IoTFier - As discussed in #1460, please retry using the docker composition. There may be transient connection issues when debugging through Visual Studio that I also need to file with the docker-compose tooling team, as the container is configured to restart while the SQL server is starting up.

wsugarman commented 2 years ago

Hey @IoTFier, as mentioned in the other issue, please re-open or file a new issue if this issue persists.