refactored to follow the original stream test

Signed-off-by: Richard Jones <richard@dagger.io>
This commit is contained in:
Richard Jones 2021-12-13 11:15:57 -07:00
parent 94ed741320
commit a78b84429d
2 changed files with 16 additions and 10 deletions

View File

@ -12,8 +12,5 @@ setup() {
@test "plan: unix socket" {
cd "$TESTDIR"
"$DAGGER" --europa up ./plan/hello-europa
run curl http://localhost:8080
assert_output --partial "<title>Hello World</title>"
docker rm -f nginx-hello
"$DAGGER" --europa up ./plan/context/services/unix
}

View File

@ -2,15 +2,24 @@ package main
import (
"alpha.dagger.io/dagger/engine"
"alpha.dagger.io/docker"
"alpha.dagger.io/dagger/op"
"alpha.dagger.io/alpine"
)
engine.#Plan & {
context: services: dockerSocket: unix: "/var/run/docker.sock"
actions: nginx: docker.#Run & {
ref: "nginxdemos/nginx-hello"
name: "nginx-hello"
ports: ["8080:8080"]
socket: context.services.dockerSocket.service
actions: {
load: op.#Load & {
from: alpine.#Image & {
package: "docker-cli": true
}
}
exec: op.#Exec & {
always: true
mount: "/var/run/docker.sock": stream: context.services.dockerSocket.service
args: ["docker", "info"]
}
}
}