Tim in BC

Dear sleepless in Seattle, this is just a guess, but I think the knock hasn’t got to do with anything touching the pipe, but the expansion/contraction of heating and cooling. My vote is to insulate the pipe if you can with some wrap to eliminate the hot/cold effect some how. It may even dampen the sound if it persists.