I learned this story from my mother. We used to live right near the Gosport Ferry, in Old Portsmouth, and in hindsight I think the sound of the chain ferry was a more likely explanation for the sound she said was the ghost of Jack The Painter swinging in his chains.
The song is on “Hooperman In The Can”, and was published in “Folk Songs of Old Hampshire”, edited by John Paddy Browne.