Happily I got the solution from another forum.
The problem is that your preferences are not being saved. That would suggest a corrupt plist file in <user>/Library/Preferences.
The Dock plist will be something like "com.apple.Dock.plist" or "com.apple.dockfixup.plist" . Try deleting that and restarting. You may of course then need to set your Dock as you want it (fortunately it left mine intact), and then check that the settings hold after reboot.