Build failed for .net core 3.1 proj

I created a project in .net core 3.1 and it refers to some lib written in target framework of core 2.2. Dotnet build is successfully and the proj runs fine locally. However docker build failed, all references of 2.2 failed to load. In the screenshot, all assemblies are failed to resolve are in 2.2.
IDK if the framework difference is the very reason but seems so, anyone experienced this?