mirror of
https://github.com/morten-olsen/morten-olsen.github.io.git
synced 2026-02-08 01:46:28 +01:00
update
This commit is contained in:
70
cue.mod/pkg/universe.dagger.io/docker/test/dockerfile.cue
generated
Executable file
70
cue.mod/pkg/universe.dagger.io/docker/test/dockerfile.cue
generated
Executable file
@@ -0,0 +1,70 @@
|
||||
package docker
|
||||
|
||||
import (
|
||||
"dagger.io/dagger"
|
||||
"dagger.io/dagger/core"
|
||||
"universe.dagger.io/docker"
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
client: filesystem: "./testdata": read: contents: dagger.#FS
|
||||
|
||||
actions: test: dockerfile: {
|
||||
simple: {
|
||||
build: docker.#Build & {
|
||||
steps: [
|
||||
docker.#Dockerfile & {
|
||||
source: dagger.#Scratch
|
||||
dockerfile: contents: """
|
||||
FROM alpine:3.15
|
||||
|
||||
RUN echo -n hello world >> /test.txt
|
||||
"""
|
||||
},
|
||||
docker.#Run & {
|
||||
command: {
|
||||
name: "/bin/sh"
|
||||
args: ["-c", """
|
||||
# Verify that docker.#Dockerfile correctly connect output
|
||||
# into other steps
|
||||
grep -q "hello world" /test.txt
|
||||
"""]
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
verify: core.#ReadFile & {
|
||||
input: build.output.rootfs
|
||||
path: "/test.txt"
|
||||
} & {
|
||||
contents: "hello world"
|
||||
}
|
||||
}
|
||||
|
||||
withInput: {
|
||||
build: docker.#Build & {
|
||||
steps: [
|
||||
docker.#Dockerfile & {
|
||||
source: client.filesystem."./testdata".read.contents
|
||||
},
|
||||
docker.#Run & {
|
||||
command: {
|
||||
name: "/bin/sh"
|
||||
args: ["-c", """
|
||||
hello >> /test.txt
|
||||
"""]
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
verify: core.#ReadFile & {
|
||||
input: build.output.rootfs
|
||||
path: "/test.txt"
|
||||
} & {
|
||||
contents: "hello world"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user