I installed docker from the snap distribution on Ubuntu 20.04.
Now I want to run docker build ... where some of the files come from a private github repository. For that to work, I want to share my keys. That works great once you understand that apparmor is in the way by default (at least on a default Linux server).
So as explained on that other question/answer, I edited the apparmor setup file:
/var/lib/snapd/apparmor/profiles/snap.docker.docker
and added a line at the end:
/run/user/1000/keyring/ssh rw,
But one time I tried again and the build failed. Looking at that file, that one line was gone. I'm thinking that the snap package was updated and it replaced that file with the default, smashing my change in the process.
My question is: Is there a way to edit a file that would not get smashed? For example, systemctl has a folder named /etc/sysctl.d where you can place your own extension configuration files. Is there something similar for apparmor at all? Especially if it comes from a snap package?