From bfd218820612f50cbbacd17fd1c706ba8c014610 Mon Sep 17 00:00:00 2001 From: Sagar Ranjan Biddanda Date: Wed, 9 Oct 2024 15:44:17 +0200 Subject: [PATCH] Handle case where a dangling image is built, and an older SHA is matched during a docker build. --- src/main/scala/sbtdocker/DockerBuild.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/scala/sbtdocker/DockerBuild.scala b/src/main/scala/sbtdocker/DockerBuild.scala index 500322e..46f5a83 100644 --- a/src/main/scala/sbtdocker/DockerBuild.scala +++ b/src/main/scala/sbtdocker/DockerBuild.scala @@ -198,6 +198,7 @@ object DockerBuild { private val SuccessfullyBuilt = "^Successfully built ([0-9a-f]+)$".r private val SuccessfullyBuiltBuildKit = ".* writing image sha256:([0-9a-f]+) .*\\bdone$".r + private val SuccessfullyBuiltBuildxDangling = ".* naming to moby-dangling@sha256:([0-9a-f]+) .*\\bdone$".r private val SuccessfullyBuiltBuildx = ".* exporting config sha256:([0-9a-f]+) .*\\bdone$".r private val SuccessfullyBuiltPodman = "^([0-9a-f]{64})$".r private val SuccessfullyBuiltNerdctl = "^Loaded image: .*sha256:([0-9a-f]+)$".r @@ -206,6 +207,7 @@ object DockerBuild { lines.collect { case SuccessfullyBuilt(id) => ImageId(id) case SuccessfullyBuiltBuildKit(id) => ImageId(id) + case SuccessfullyBuiltBuildxDangling(id) => ImageId(id) case SuccessfullyBuiltBuildx(id) => ImageId(id) case SuccessfullyBuiltPodman(id) => ImageId(id) case SuccessfullyBuiltNerdctl(id) => ImageId(id)