diff --git a/shlax/image.py b/shlax/image.py index 45ed9ec..dc58635 100644 --- a/shlax/image.py +++ b/shlax/image.py @@ -60,9 +60,11 @@ class Image: setattr(self, k, v) # docker.io currently has issues with oci format - self.format = format or 'oci' 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 self.tags = [t for t in self.tags if t] diff --git a/shlax/targets/buildah.py b/shlax/targets/buildah.py index 6d6c45e..60617ab 100644 --- a/shlax/targets/buildah.py +++ b/shlax/targets/buildah.py @@ -145,8 +145,19 @@ class Buildah(Target): async def commit(self): 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 = ( # gitlab