add ability to load custom images from file (also not hardcoded anymore)
This commit is contained in:
parent
6a6680403f
commit
021d2f0aa5
3 changed files with 18 additions and 8 deletions
17
blend
17
blend
|
@ -27,6 +27,7 @@ import getpass
|
||||||
import pexpect
|
import pexpect
|
||||||
import argparse
|
import argparse
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import yaml
|
||||||
|
|
||||||
__version = '2.0.0'
|
__version = '2.0.0'
|
||||||
|
|
||||||
|
@ -93,14 +94,14 @@ def podman_it_remover(cmd: list):
|
||||||
# END
|
# END
|
||||||
|
|
||||||
|
|
||||||
distro_map = {
|
distro_map = yaml.safe_load(open('/usr/share/blend/images.yaml'))
|
||||||
'arch-linux': 'quay.io/toolbx/arch-toolbox:latest',
|
if os.path.exists(f'/etc/blend/images.yaml'):
|
||||||
'debian': 'quay.io/toolbx-images/debian-toolbox:testing',
|
distro_map += yaml.safe_load(
|
||||||
'fedora-42': 'quay.io/fedora/fedora-toolbox:42',
|
open(f'{os.getenv('XDG_CONFIG_HOME')}/blend/images.yaml'))
|
||||||
'centos': 'quay.io/toolbx-images/centos-toolbox:latest',
|
|
||||||
'ubuntu-22.04': 'quay.io/toolbx/ubuntu-toolbox:22.04',
|
if os.path.exists(f'{os.getenv('XDG_CONFIG_HOME')}/blend/images.yaml'):
|
||||||
'ubuntu-24.04': 'quay.io/toolbx/ubuntu-toolbox:24.04',
|
distro_map += yaml.safe_load(
|
||||||
}
|
open(f'{os.getenv('XDG_CONFIG_HOME')}/blend/images.yaml'))
|
||||||
|
|
||||||
default_distro = 'arch-linux'
|
default_distro = 'arch-linux'
|
||||||
|
|
||||||
|
|
3
images.example.yaml
Normal file
3
images.example.yaml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# Here you can put custom images to be used for blend
|
||||||
|
# for example:
|
||||||
|
# opensuse: quay.io/exampleauthor/opensuse:15
|
6
images.yaml
Normal file
6
images.yaml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
arch-linux: quay.io/toolbx/arch-toolbox:latest
|
||||||
|
debian: quay.io/toolbx-images/debian-toolbox:testing
|
||||||
|
fedora-42: quay.io/fedora/fedora-toolbox:42
|
||||||
|
centos: quay.io/toolbx-images/centos-toolbox:latest
|
||||||
|
ubuntu-22.04: quay.io/toolbx/ubuntu-toolbox:22.04
|
||||||
|
ubuntu-24.04: quay.io/toolbx/ubuntu-toolbox:24.04
|
Loading…
Add table
Add a link
Reference in a new issue