I had a somewhat snarky answer earlier.
I'd say it's much more likely the pre-configured docker digital ocean makes available is on hardware that isn't as heavily used as a regular old postgress configuration.
That is, there's more load in general on the postgress machine rather than the docker machine, you don't get perfect isolation in those environments.