Replies: 16 comments
-
[Triage] This looks like an issue with the Visual Studio container tooling/targets as you mentioned. Please file an issue on https://github.com/microsoft/dockertools/issues instead. |
Beta Was this translation helpful? Give feedback.
-
This issue actually happens also when I try to build the image from the command line (from sln directory): Command: docker build -t manual-built-app:10.6.1.0 --progress=plain -f .\MyApp.Api\Dockerfile --build-arg buildnumber=10.6.1.0 . Output:
So it doesn't seem to be Visual Studio or tooling related. It's strictly related to the jammy-chiseled image. @lbussell Please reopen this issue. |
Beta Was this translation helpful? Give feedback.
-
@Arclight3 - You're getting a different error than the original post. Please log a new issue here. |
Beta Was this translation helpful? Give feedback.
-
Alright but it's the same problem. First I presented the VS output, now the cli output. :) |
Beta Was this translation helpful? Give feedback.
-
Ah, sorry about that. I didn't realize you were the OP. |
Beta Was this translation helpful? Give feedback.
-
No worries. Thanks for reopening it! 😄 |
Beta Was this translation helpful? Give feedback.
-
[Triage] Looking at your build error, |
Beta Was this translation helpful? Give feedback.
-
# Build stage/image
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
#FROM mcr.microsoft.com/dotnet/sdk:7.0-jammy AS build
WORKDIR /source
COPY ["nuget.config", "."]
COPY ["MyApp/MyApp.Api.csproj", "MyApp.Api/"]
ENV NUGET_XMLDOC_MODE none
RUN dotnet restore "MyApp.Api/MyApp.Api.csproj" --configfile nuget.config
COPY [".", "."]
WORKDIR "/source/MyApp.Api"
ARG buildnumber
RUN dotnet publish "MyApp.Api.csproj" --no-restore -c Release -p:Version=$buildnumber -o /app
# Final stage/image
FROM mcr.microsoft.com/dotnet/aspnet:7.0 as final
#FROM mcr.microsoft.com/dotnet/aspnet:7.0-jammy as final
#FROM mcr.microsoft.com/dotnet/aspnet:7.0-jammy-chiseled as final
WORKDIR /app
COPY --from=build /app .
EXPOSE 8080
ENV ASPNETCORE_URLS=http://*:8080
ENTRYPOINT ["./MyApp.Api"] All combinations of images presented in the Dockerfile above fail with these errors:
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
#FROM mcr.microsoft.com/dotnet/aspnet:7.0-jammy AS base
WORKDIR /app
EXPOSE 8080
ENV ASPNETCORE_URLS=http://*:8080
# Build stage/image
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
#FROM mcr.microsoft.com/dotnet/sdk:7.0-jammy AS build
WORKDIR /source
COPY ["nuget.config", "."]
COPY ["MyApp.Api/MyApp.Api.csproj", "MyApp.Api/"]
ENV NUGET_XMLDOC_MODE none
RUN dotnet restore "MyApp.Api/MyApp.Api.csproj" --configfile nuget.config
COPY [".", "."]
WORKDIR "/source/MyApp.Api"
ARG buildnumber
RUN dotnet publish "MyApp.Api.csproj" --no-restore -c Release -p:Version=$buildnumber -o /app
# Final stage/image
FROM base AS final
WORKDIR /app
COPY --from=build /app .
ENTRYPOINT ["./MyApp.Api"]
FROM mcr.microsoft.com/dotnet/aspnet:7.0-jammy-chiseled AS base
WORKDIR /app
EXPOSE 8080
ENV ASPNETCORE_URLS=http://*:8080
# Build stage/image
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
#FROM mcr.microsoft.com/dotnet/sdk:7.0-jammy AS build
WORKDIR /source
COPY ["nuget.config", "."]
COPY ["MyApp.Api/MyApp.Api.csproj", "MyApp.Api/"]
ENV NUGET_XMLDOC_MODE none
RUN dotnet restore "MyApp.Api/MyApp.Api.csproj" --configfile nuget.config
COPY [".", "."]
WORKDIR "/source/MyApp.Api"
ARG buildnumber
RUN dotnet publish "MyApp.Api.csproj" --no-restore -c Release -p:Version=$buildnumber -o /app
# Final stage/image
FROM base AS final
WORKDIR /app
COPY --from=build /app .
ENTRYPOINT ["./MyApp.Api"] Conclusions:
|
Beta Was this translation helpful? Give feedback.
-
[Triage] We haven't forgotten about this issue - we'd like to continue investigation after the new year. |
Beta Was this translation helpful? Give feedback.
-
Hi. Any updates? :) |
Beta Was this translation helpful? Give feedback.
-
I took a look at this today. Here's what I did:
Then I was able to build the Dockerfile with the command Then I tried running via Docker in Visual Studio. Using jammy-chiseled didn't work because Visual Studio (or the I still think that your CLI output looks like a problem with your Docker installation. I have a few suggestions for you -
|
Beta Was this translation helpful? Give feedback.
-
We came to the conclusion that adding |
Beta Was this translation helpful? Give feedback.
-
[Triage] Converting this to a discussion because there isn't any obvious work to be done here but we're interested in continuing the conversation. |
Beta Was this translation helpful? Give feedback.
-
Something that I have been doing is copying debug only dependencies into a specific fastmode stage in the docker file
And in the csproj |
Beta Was this translation helpful? Give feedback.
-
Any updates? |
Beta Was this translation helpful? Give feedback.
-
The problem was fixed. More details here: microsoft/DockerTools#409. |
Beta Was this translation helpful? Give feedback.
-
Describe the Bug
I have a .net 7 Web API with this config:
I am using the latest version of Visual Studio (17.8.1) and Docker (4.25.2).
I have the .net 7 (7.0.311) and .net 8 (8.0.100) SDKs installed (latest patches).
I have this Dockerfile:
My launchSettings.json is:
Initially I was using the
mcr.microsoft.com/dotnet/aspnet:7.0
base image and everything worked fine.After I update the Dockerfile to use the
mcr.microsoft.com/dotnet/aspnet:7.0-jammy-chiseled
image (or the 8.0-jammy-chiseled), I get this error in Visual Studio when I run the application in Docker:vs_log_0.txt
I have read and followed the instructions from this page: https://github.com/dotnet/dotnet-docker/blob/main/documentation/ubuntu-chiseled.md and I think my Dockerfile looks ok. I think it's a support problem with Visual Studio or the
Microsoft.VisualStudio.Azure.Containers.Tools.Targets
NuGet package regarding the newjammy-chiseled
Docker images.Please let me know if I can provide more information.
Steps to Reproduce
Other Information
Output of
docker version
docker_version_output.txt
Output of
docker info
docker_info_output.txt
Beta Was this translation helpful? Give feedback.
All reactions