Skip to content

Instantly share code, notes, and snippets.

@dolanor
Created April 29, 2022 09:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dolanor/5426c406bdff4276c3523ce9c19d3268 to your computer and use it in GitHub Desktop.
Save dolanor/5426c406bdff4276c3523ce9c19d3268 to your computer and use it in GitHub Desktop.
Inject values in a dagger do run
package main
import (
"dagger.io/dagger"
"universe.dagger.io/bash"
"universe.dagger.io/docker"
)
dagger.#Plan & {
actions: {
params: {
myval: string
}
_pull: docker.#Pull & {
source: "index.docker.io/debian"
}
_image: _pull.output
exec: bash.#Run & {
input: _image
script: contents: """
echo \(params.myval)
echo done
"""
}
}
}
dagger do exec --with 'actions: params: myval: "Hello World"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment