Skip to content

Buildx target.matrix CLI override #2398

Answered by dvdksn
Nithos asked this question in Q&A
Apr 10, 2024 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

How about using a ternary/variable to check for an override? Something like:

variable "MATRIX_OVERRIDE" { default="" }

function "list" {
  params = []
  variadic_params = items
  result = items
}

target "app" {
  name = "app-${tgt}"
  matrix = {
    tgt = notequal("",MATRIX_OVERRIDE) ? list(MATRIX_OVERRIDE) : list("foo", "bar")
  }
  target = tgt
}

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@Nithos
Comment options

Answer selected by Nithos
Comment options

You must be logged in to vote
2 replies
@lemeurherve
Comment options

@lemeurherve
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants