Docs: add content to 1205: "building container images"

Signed-off-by: Solomon Hykes <solomon@dagger.io>
This commit is contained in:
Solomon Hykes
2022-04-05 01:04:40 +00:00
parent f3ac279f73
commit 26cbc7dc68
3 changed files with 47 additions and 20 deletions

View File

@@ -5,16 +5,23 @@ import (
"universe.dagger.io/docker"
)
dagger.#Plan & {
client: filesystem: "./src": read: contents: dagger.#FS
// This action builds a docker image from a python app.
// Build steps are defined in native CUE.
#PythonBuild: {
// Source code of the Python application
app: dagger.#FS
actions: build: docker.#Build & {
// Container image
image: _build.output
// Build steps
_build: docker.#Build & {
steps: [
docker.#Pull & {
source: "python:3.9"
},
docker.#Copy & {
contents: client.filesystem."./src".read.contents
contents: app
dest: "/app"
},
docker.#Run & {
@@ -29,3 +36,12 @@ dagger.#Plan & {
]
}
}
// Example usage in a plan
dagger.#Plan & {
client: filesystem: "./src": read: contents: dagger.#FS
actions: build: #PythonBuild & {
app: client.filesystem."./src".read.contents
}
}