Rm: cannot remove '/var/lib/apt/lists/': Permission denied

Without a full Dockerfile nor the full output, it’ll be hard to say for sure.

My guess is that you have a USER directive in your Dockerfile above your Step 37 RUN directive that is failing. If the user that you specified doesn’t have permission to run rm -rf /var/lib/apt/lists/, then I would expect the error you are getting.