To glue the end caps on just use silicone caulk. I smeared a thin layer on the pipe, and inner surface of the cap, stuck them together, then caulked a nice bead around the junction and smoothed it with the magic finger to ensure that it was a good seal. Silicone allows you to take it apart next...