Skip to content

Instantly share code, notes, and snippets.

@brk3
Last active April 12, 2022 11:53
Show Gist options
  • Save brk3/efce0598dbe20aced222419d27c54dcf to your computer and use it in GitHub Desktop.
Save brk3/efce0598dbe20aced222419d27c54dcf to your computer and use it in GitHub Desktop.
package test
import (
"dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/docker"
)
dagger.#Plan & {
actions: {
rover: {
alpine: docker.#Pull & {source: "alpine:3"}
foocache: "/foo": {
dest: "/foo"
type: "cache"
contents: core.#CacheDir & {
id: "foo"
}
}
writecache: docker.#Run & {
input: alpine.image
user: "root"
command: name: "echo"
command: args: [ "hello!", ">", "/foo/hello.txt" ]
always: true
mounts: foocache
}
readcache: docker.#Run & {
input: alpine.image
user: "root"
command: name: "cat"
command: args: [ "/foo/hello.txt" ]
always: true
env: DEP: "\(writecache.success)"
mounts: foocache
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment