stdlib package: docker
Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
This commit is contained in:
parent
9d916a2fc2
commit
41c973ba04
36
stdlib/docker/docker.cue
Normal file
36
stdlib/docker/docker.cue
Normal 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},
|
||||
]
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user