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:
@@ -28,8 +28,7 @@ def main():
|
||||
print('Setting up hub environment')
|
||||
initial_setup = True
|
||||
subprocess.check_output(['apt-get', 'update', '--yes'])
|
||||
# gnupg2 is needed for nodesource to work
|
||||
subprocess.check_output(['apt-get', 'install', '--yes', 'python3', 'python3-venv', 'gnupg2'])
|
||||
subprocess.check_output(['apt-get', 'install', '--yes', 'python3', 'python3-venv'])
|
||||
os.makedirs(hub_prefix, exist_ok=True)
|
||||
subprocess.check_output(['python3', '-m', 'venv', hub_prefix])
|
||||
|
||||
|
||||
@@ -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