Tried lots of searches for this and am drawing a blank.
I have a docker file that isn't building. I'd like to do something like: RUN echo $(ls *) and see what exactly is in my current directory. Cause I feel like something is missing as I'm getting weird errors when I run my dotnet restore command. When I run said command locally the command works just fine. And the same command works for other dockerfiles in other projects.
How can I see what the content of my docker image is while it is being build?
Edit: Adding Dockerfile:
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
#FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS build
#FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS build
ARG FEED_ACCESSTOKEN
ARG version
ENV USE_NET6_ARTIFACTS_CREDENTIAL_PROVIDER=false
ENV NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED true
ENV VSS_NUGET_EXTERNAL_FEED_ENDPOINTS \
"{\"endpointCredentials\": [{\"endpoint\":\"https://pkgs.dev.azure.com/<CompanyNameHere>/_packaging/<CompanyNameHere>/nuget/v3/index.json\", \"username\":\"docker\", \"password\":\"${FEED_ACCESSTOKEN}\"}]}"
RUN curl -L https://raw.githubusercontent.com/Microsoft/artifacts-credprovider/master/helpers/installcredprovider.sh | bash
RUN echo "${FEED_ACCESSTOKEN}"
WORKDIR /src
COPY NuGet.Config .
COPY src/AppPortal.Web/*.csproj AppPortal.Web/
RUN dotnet restore AppPortal.Web/AppPortal.Web.csproj --configfile NuGet.Config
COPY src/ .
# Remove any appsettings (except appsettings.json) so they do not get bundled in the docker image
RUN find . -type f -name appsettings.*.json -exec rm {} \;
WORKDIR /src/AppPortal.Web
RUN dotnet build "AppPortal.Web.csproj" -c Release --no-restore
FROM build AS publish
WORKDIR /src/AppPortal.Web
RUN dotnet publish "AppPortal.Web.csproj" -c Release -o /app --no-build
FROM base AS final
WORKDIR /src
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "AppPortal.Web.dll"]
Error Message:
Removing intermediate container 9dfae1c6d08b
---> 48358f7e2161
Step 21/35 : RUN dotnet restore AppPortal.Web/AppPortal.Web.csproj --configfile NuGet.Config
---> Running in b4e6724f09d9
It was not possible to find any installed .NET Core SDKs
Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
https://aka.ms/dotnet-download
The command '/bin/sh -c dotnet restore AppPortal.Web/AppPortal.Web.csproj --configfile NuGet.Config' returned a non-zero code: 145
Running the same dotnet restore command locally works just fine.