Minecraft wiki entry for Shelters, associated text: Water currents. By using a bucket to remove the top layer in 2+ deep water, you create a + shaped water current flowing towards the center. You can use this to hold boats, while still being able to escape somewhat easily. This design does not always prevent the boats from moving if you or a mob bumps into it, but will help prevent it from drifting away.