89luca89 / 89luca89/distrobox

[Discussion] Separate GPG between container and host

Open
#701 7 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Go
Stars
13k
Forks
541
Avg merge
20h 47m
Merged PRs (30d)
4

Description

# Context

I am using SteamOS 3, and have been daily driving an Arch Linux distrobox container for all of my development work. For this discussion though, I believe what distro the container is running is irrelevant. My container was created with a custom `$HOME` directory, as I do not want to have configurations of both systems to clash when I do not want them to. Anything that I'm fine with sharing, I would just symlink them from the host's home directory to the container's.

# Issue

My workplace enforces GPG signing for our git commits. At first, I simply set up my GPG key for GitHub on my host system, then symlinked the `~/.gnupg` directory from the host to the container's. This initially worked as far as I can tell. I'm not too familiar with GPGs but I know they're important, so I don't really feel safe doing this and would prefer having them separate.

Recently though, I got the error `WARNING: server 'gpg-agent' is older than us (2.2.40 < 2.2.41)` when I tried signing my git commit from my container. This also happens if I remove the `~/.gnupg` symlink and try to generate a new GPG key from my container with the command: `gpg --full-gen-key`. Upon checking, `gpg` is of version `2.2.41` on my container and `2.2.40` on my host system - which might be the cause of this issue.

I really love the idea of having an immutable system such as SteamOS 3 and using a distrobox container based on Arch for my work - getting through this hurdle would mean a lot. I'm familiar with containerisation such as Docker, etc. but after religiously reading Distrobox's wiki, I know they've done a *lot* more than that, and looking for a solution to this has left me at a loss. Google has never worked out for me too when it comes to Distrobox.

# Desired Solution

Does anyone have a solution or pointer they can share on how I might be able to separate these two system's GPG setup to avoid version clashes like I think I am facing? Feel free to add in an alternative solution that you think might even be better.

I'm also curious as to how people get through this when they're using a host system based on distro A and a containerised system based on distro B - despite sharing _some_ parts of the host's root directory. Surely, that'd bring up a variety of different issues I might not have encountered/thought of yet?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.