The ROS publisher/subscriber example packaged as a snap, based on ROS Noetic and Ubuntu Core 20. Strictly confined. This example is available on ROS wiki, here.
Just launch snapcraft
from top dir, it will create the snap publisher-subscriber_0.1_xxxx.snap
snap install publisher-subscriber_0.1_xxxx.snap --dangerous
Open a shell then launch roscore
publisher-subscriber.roscore
Open a shell then launch the talker
publisher-subscriber.talker
Open a shell then launch the listener
publisher-subscriber.listener