stdlib: improved Docker package

Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
This commit is contained in:
Solomon Hykes
2021-04-06 21:20:21 +00:00
parent d522fc3396
commit 647e4c898b
7 changed files with 49 additions and 122 deletions

41
stdlib/docker/image.cue Normal file
View File

@@ -0,0 +1,41 @@
package docker
import (
"dagger.io/dagger"
"dagger.io/dagger/op"
)
// Build a Docker image from source, using included Dockerfile
#ImageFromSource: {
source: dagger.#Artifact
#up: [
op.#DockerBuild & {
context: source
},
]
}
// Fetch an image from a remote registry
#ImageFromRegistry: {
ref: string
#up: [
op.#FetchContainer & {
"ref": ref
},
]
}
// Build a Docker image from the provided Dockerfile contents
#ImageFromDockerfile: {
dockerfile: string
context: dagger.#Artifact
#up: [
op.#DockerBuild & {
"context": context
"dockerfile": dockerfile
},
]
}