Skip to content

Commit

Permalink
Add regex support to grab correct imageId when using containerd
Browse files Browse the repository at this point in the history
  • Loading branch information
edrzmr committed Oct 1, 2024
1 parent 6fafbb1 commit 7cf2cad
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/scala/sbtdocker/DockerBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ object DockerBuild {
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
private val SuccessfullyBuiltContainerd = ".* unpacking to moby-dangling@sha256:([0-9a-f]+) .*\\bdone$".r

private[sbtdocker] def parseImageId(lines: Seq[String]): Option[ImageId] = {
lines.collect {
Expand All @@ -209,6 +210,7 @@ object DockerBuild {
case SuccessfullyBuiltBuildx(id) => ImageId(id)
case SuccessfullyBuiltPodman(id) => ImageId(id)
case SuccessfullyBuiltNerdctl(id) => ImageId(id)
case SuccessfullyBuiltContainerd(id) => ImageId(id)
}.lastOption
}
}
Expand Down

0 comments on commit 7cf2cad

Please sign in to comment.