I am new in docker and I have some problem when I load my image.
I have a docker image that I want to publish, it all is working locally on my pc, but when I save my docker image and try to load it, I see that my docker image is not working. It does not have any data in it.
Here is my dockerfile with which I use to built my image.
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
FROM GitHub - microsoft/containerregistry: Microsoft Container Registry description and related FAQ AS build
COPY [“MyWebProj.csproj”, “”]
RUN dotnet restore “./MyWebProj.csproj”
COPY . .
RUN dotnet build “MyWebProj.csproj” -c Release -o /app/build
FROM build AS publish
RUN dotnet publish “MyWebProj.csproj” -c Release -o /app/publish
FROM base AS final
COPY --from=publish /app/publish .
ENTRYPOINT [“dotnet”, “MyWebProj.dll”]
I save my image with next docker commands:
- docker commit MyWebProj33
- docker save -o MyWebProj33.tar MyWebProj33
Then I load the image with the next command:
- docker load --input MyWebProj33.tar
The image is loaded succesfully, but when the website is not working, because it is empty. When I go inisde the loaded image and check the directory /app or /src, they are empty.
Any idea what I do wrong?