As I said in my other reply, Docker is more likely to have ephemeral storage for the cache. So every single lock it'll re-download the package. Whereas locally, you're likely to still have the packages cached.
This can make a difference of tens of minutes for some packages which have a 1 gigabyte (!!!) download.