Force docker format

Newer versions of buildah create OCI containers but the undercloud
registry does not support the OCI container metadata format so these
cannot be used with newer podman.  For now this can be worked around by
explicitly passing --format docker when running buildah build related
commands.

Change-Id: I25c7a239add99e2d4dac433794d6ca92a58942b6
Related-Bug: #1860585
(cherry picked from commit 39f0f369b9)
This commit is contained in:
Alex Schultz 2020-01-22 12:10:58 -07:00
parent 8c91da0ea0
commit 6fc665cbb6
2 changed files with 6 additions and 2 deletions

View File

@ -122,7 +122,10 @@ class BuildahBuilder(base.BaseBuilder):
# TODO(emilien): Stop ignoring TLS. The deployer should either secure
# the registry or add it to insecure_registries.
logfile = container_build_path + '/' + container_name + '-build.log'
args = self.buildah_cmd + ['bud', '--tls-verify=False', '--logfile',
# TODO(aschultz): drop --format docker when oci format is properly
# supported by the undercloud registry
args = self.buildah_cmd + ['bud', '--format', 'docker',
'--tls-verify=False', '--logfile',
logfile, '-t', destination,
container_build_path]
print("Building %s image with: %s" % (container_name, ' '.join(args)))

View File

@ -86,7 +86,8 @@ class TestBuildahBuilder(base.TestCase):
dest = '127.0.0.1:8787/master/fedora-binary-fedora-base:latest'
container_build_path = WORK_DIR + '/' + 'fedora-base'
logfile = '/tmp/kolla/fedora-base/fedora-base-build.log'
buildah_cmd_build = ['bud', '--tls-verify=False', '--logfile',
buildah_cmd_build = ['bud', '--format', 'docker',
'--tls-verify=False', '--logfile',
logfile, '-t', dest, container_build_path]
args.extend(buildah_cmd_build)
bb(WORK_DIR, DEPS).build('fedora-base', container_build_path)