Skip to content

Commit ab2fe4e

Browse files
authored
Merge pull request #1457 from rgaiacs/1452-check-buildx
Add check for docker buildx
2 parents 724ac17 + 9bf010e commit ab2fe4e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

repo2docker/docker.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,13 @@ def build(
107107
):
108108
if not shutil.which("docker"):
109109
raise RuntimeError("The docker commandline client must be installed")
110+
111+
# docker buildx is based in a plugin that might not be installed
112+
# https://github.com/docker/buildx
113+
docker_buildx_version = subprocess.run(["docker", "buildx", "version"])
114+
if docker_buildx_version.returncode:
115+
raise RuntimeError("The docker buildx plugin must be installed")
116+
110117
args = ["docker", "buildx", "build", "--progress", "plain"]
111118
if load:
112119
if push:

0 commit comments

Comments
 (0)