diff options
| author | Michal Nasiadka <mnasiadka@gmail.com> | 2026-06-11 21:47:52 +0100 |
|---|---|---|
| committer | Michal Nasiadka <mnasiadka@gmail.com> | 2026-06-18 08:54:32 +0000 |
| commit | 4e66cc2f5982cdab26e3838411a37ea115fd7ef5 (patch) | |
| tree | c1df2f352c8a5779ed29ee0f429c8ef7142fe302 /kolla/image/build.py | |
| parent | 4e85395936cf17d6912b68fc51ca6c18e90156f7 (diff) | |
| download | kolla-4e66cc2f5982cdab26e3838411a37ea115fd7ef5.tar.gz kolla-4e66cc2f5982cdab26e3838411a37ea115fd7ef5.zip | |
kolla-build: Add Docker BuildKit support via docker buildx build
Add --buildkit flag to use docker buildx build instead of the docker-py
SDK. An optional --buildkit-builder selects a named buildx builder
instance, enabling docker-container or remote drivers for multi-arch
builds.
--buildkit and --squash are mutually exclusive and rejected at startup.
PushTask is skipped when buildkit is active; push is handled inline.
Set buildkit as the new default.
Change-Id: Idbf1d1bdc091bb84721f8006c2b916731b999859
Signed-off-by: Michal Nasiadka <mnasiadka@gmail.com>
Diffstat (limited to 'kolla/image/build.py')
| -rw-r--r-- | kolla/image/build.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/kolla/image/build.py b/kolla/image/build.py index 9b6571d36..a0513b22a 100644 --- a/kolla/image/build.py +++ b/kolla/image/build.py @@ -120,6 +120,10 @@ def run_build(): "Try running 'pip install docker'\n" "Python error: %s", e) sys.exit(1) + if conf.buildkit and conf.squash: + LOG.error('--buildkit and --squash are mutually exclusive: ' + 'docker buildx build does not support squashing.') + sys.exit(1) if conf.squash: squash_version = utils.get_docker_squash_version() LOG.info('Image squash is enabled and "docker-squash" version ' @@ -171,6 +175,12 @@ def run_build(): kolla.list_dependencies() return + if (conf.engine == engine.Engine.DOCKER.value and conf.buildkit): + try: + utils.check_docker_buildx() + except Exception: + sys.exit(1) + push_queue = queue.Queue() build_queue = kolla.build_queue(push_queue) workers = [] |
