stdlib package: docker

Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
This commit is contained in:
Solomon Hykes 2021-03-12 23:07:11 +00:00
parent 9d916a2fc2
commit 41c973ba04

36
stdlib/docker/docker.cue Normal file
View File

@ -0,0 +1,36 @@
package docker
import (
"dagger.io/dagger"
)
#Ref: string
// Build a docker container image
#Build: {
source: dagger.#Dir
image: #compute: [
dagger.#DockerBuild & {context: source},
]
}
#Run: {
args: [...string]
// image may be a remote image ref, or a computed artifact
{
image: #Ref
out: #compute: [
dagger.#FetchContainer & {ref: image},
dagger.#Exec & {"args": args},
]
} | {
image: _
out: #compute: [
dagger.#Load & {from: image},
dagger.#Exec & {"args": args},
]
}
}