Docker Community Forums

Share and learn in the Docker community.

Cant Update Class .Net Core With Docker

Hello,
I have a project that include directories, class libraries and web applications. In a directory I have class library and inside there is a class. When I updated this class, in another directory I have a .net core project I dockerized with docker-compose before didin’t changed.Also this projects dependencies has this class. I builded/rebuilded class and .net core project . I remove image and docker-compose up again , but there is no update. Whats hould I do ? Please help.

This is my solution explorer on visual studio

* Core (Class Library)

    * abc.cs (I updated this class, added a property like public string Language {get;set;})

* Services (Folder)

    * StreamApi (.Net Core Application)

      * Dockerfile,Program.cs,Startup.cs etc. all files is here.

This is my dockerfile :

FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 AS base
WORKDIR /app                                                                              FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build
WORKDIR /src
COPY [StreamAPI/StreamAPI.csproj", "StreamAPI/"]
RUN dotnet restore "StreamAPI/StreamAPI.csproj"
COPY . .
WORKDIR "/src/StreamAPI"
RUN dotnet build "StreamAPI.csproj" -c Release -o /app

FROM build AS publish
RUN dotnet publish "StreamAPI.csproj" -c Release -o /app

FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENV ASPNETCORE_URLS=http://+:7008
ENV ASPNETCORE_ENVIRONMENT docker
ENTRYPOINT ["dotnet", "StreamAPI.dll"]  

And my yml file :

version: '3.4'
services:
  stream-api:
    container_name: stream.api
    image: ${DOCKER_REGISTRY-}stream.api
    build:
      context: .
      dockerfile: StreamAPI/Dockerfile
    ports:
      - "7006:7006"
    network_mode: networkName
    restart: unless-stopped 

How can I get updated container ? Any help is apprepiated.Thank you so much