docs: added abililty to run a local registry for todoapp example

Signed-off-by: Sam Alba <sam.alba@gmail.com>
This commit is contained in:
Sam Alba
2021-10-05 18:15:38 -07:00
parent 6b74006ddd
commit d39cc200ca
4 changed files with 27 additions and 11 deletions

View File

@@ -5,15 +5,29 @@ import (
"alpha.dagger.io/docker"
)
// docker local socket
dockerSocket: dagger.#Stream & dagger.#Input
// run our todoapp in our local Docker engine
run: docker.#Run & {
ref: push.ref
name: "todoapp"
ports: ["8080:80"]
socket: dagger.#Stream & dagger.#Input
socket: dockerSocket
}
// run our local registry
registry: docker.#Run & {
ref: "registry:2"
name: "registry-local"
ports: ["5000:5000"]
socket: dockerSocket
}
// push to our local registry
// this concrete value satisfies the string constraint
// we defined in the previous file
push: target: "localhost:5000/todoapp"
// output the application URL
appURL: "http://localhost:8080/" & dagger.#Output