You need to both install dotnet-tool and set up path so that it is found:
RUN dotnet tool install --global dotnet-ef ENV PATH="$PATH:/root/.dotnet/tools" RUN dotnet ef database update