mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
Install gpg2 if required when adding apt keys
Not installed by default in many docker containers
This commit is contained in:
@@ -11,6 +11,9 @@ def trust_gpg_key(key):
|
||||
|
||||
key is a GPG public key (bytes) that can be passed to apt-key add via stdin.
|
||||
"""
|
||||
# If gpg2 doesn't exist, install it.
|
||||
if not os.path.exists('/usr/bin/gpg2'):
|
||||
install_packages(['gnupg2'])
|
||||
subprocess.run(['apt-key', 'add', '-'], input=key, check=True)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user