Skip to content

support iteration to generate steps from sequence #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
joprice opened this issue Aug 12, 2024 · 0 comments
Open

support iteration to generate steps from sequence #3

joprice opened this issue Aug 12, 2024 · 0 comments

Comments

@joprice
Copy link

joprice commented Aug 12, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant