Add docker daemon support

This commit is contained in:
jpic 2020-12-07 11:16:31 +01:00
parent 77439b6dc3
commit a80e3fb48c
2 changed files with 16 additions and 3 deletions

View File

@ -60,9 +60,11 @@ class Image:
setattr(self, k, v) setattr(self, k, v)
# docker.io currently has issues with oci format # docker.io currently has issues with oci format
self.format = format or 'oci'
if self.registry == 'docker.io': if self.registry == 'docker.io':
self.format = 'docker' self.backend = 'docker'
if not self.format:
self.format = 'docker' if self.backend == 'docker' else 'oci'
# filter out tags which resolved to None # filter out tags which resolved to None
self.tags = [t for t in self.tags if t] self.tags = [t for t in self.tags if t]

View File

@ -145,8 +145,19 @@ class Buildah(Target):
async def commit(self): async def commit(self):
await self.parent.exec( await self.parent.exec(
f'buildah commit {self.ctr} {self.image.repository}:final' 'buildah',
'commit',
f'--format={self.image.format}',
self.ctr,
f'{self.image.repository}:final',
) )
if self.image.backend == 'docker':
await self.parent.exec(
'buildah',
'push',
f'{self.image.repository}:final',
f'docker-daemon:{self.image.repository}:latest'
)
ENV_TAGS = ( ENV_TAGS = (
# gitlab # gitlab