This commit is contained in:
Gilles Grandou 2023-12-03 21:20:04 +01:00
parent 60202fff83
commit e3d2c356ba
1 changed files with 7 additions and 2 deletions

View File

@ -84,10 +84,14 @@ def build_image(conf, update, verbose):
print('image: {} up-to-date'.format(image_name))
return image_name
image = conf.get('image')
dockerfile = conf.get('dockerfile')
pkginstall = conf.get('pkginstall')
packages = conf.get('packages')
if not dockerfile:
dockerfile = []
if image:
dockerfile.insert(0, 'FROM {}'.format(image))
if packages:
for p in packages:
dockerfile.append(pkginstall.format(p))
@ -108,7 +112,8 @@ def build_image(conf, update, verbose):
if not os.path.exists(cache_dir):
os.mkdir(cache_dir)
with open(cache_file, 'w') as file:
print('cache: {}'.format(cache_file))
if verbose:
print('cache: {}'.format(cache_file))
file.write('')
return image_name