FSharp.Text.Docker
FSharp.Text.Docker copied to clipboard
support iteration to generate steps from sequence
It would be convenient to be able to iterate over a sequence to generate commands, for example
for src, dest in [ "file-1", "b"; "file-2", "b" ] do
yield! dockerfile { copy src dest }
Not sure if there's a more ideal way to express that, but this seems to work with this implementation in the builder:
member this.For(items, f) : DockerfileSpec =
let mutable result = { Instructions = [] }
for item in items do
result <- this.Combine(result, f item)
result