Browse Source

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)
changes/96/703996/1
Alex Schultz 4 weeks ago
parent
commit
6fc665cbb6
2 changed files with 6 additions and 2 deletions
  1. +4
    -1
      tripleo_common/image/builder/buildah.py
  2. +2
    -1
      tripleo_common/tests/image/builder/test_buildah.py

+ 4
- 1
tripleo_common/image/builder/buildah.py 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)))

+ 2
- 1
tripleo_common/tests/image/builder/test_buildah.py 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)

Loading…
Cancel
Save