dagger: Nested docker.#Build fails

When using docker.#Build as a step within another docker.#Build, dagger throws CUE errors.

I’ve narrowed it down to builds containing multiple steps:

_build: docker.#Build & {
	steps: [
		docker.#Build & {
			steps: [
				docker.#Pull & {
					source: "alpine"
				},
				// FIXME: the following breaks with:
				// actions.deploy._build._dag."0".output: 1 errors in empty disjunction::
				//    pkg/universe.dagger.io/docker/build.cue:26:11
				docker.#Run & {
					cmd: name: "ls"
				},
			]
		},
		docker.#Run & {
			cmd: name: "ls"
		},
	]
}

/cc @shykes

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 27 (20 by maintainers)

Most upvoted comments

I’m having the same problem, which is preventing me from using Dagger, and look forward to a solution soon.

has this been sorted now?

No solution yet, but we have prioritized it. Sorry.

As discussed on discord, I have the same issue on a gcp package. Hope this gets fixed soon. I’ve basically got 3.nested docker.#Build which would be really convenient if it did work. For now I’ll break down my docker.#Build in order to have my package working. I’m definitely looking forward to changing my package once this works.

@shykes I think you’re referring to https://github.com/cue-lang/cue/issues/474 (which also links to https://github.com/cue-lang/cue/issues/1348).

A drive-by question on the suggestion above to change from a list to a struct, but does doing so not rule out the possibility of ever parallelising the steps? That question might be moot in the context of Docker build, however; I defer to you on that point!

Simplified repro case:

#TestStep: {
	input:  #Image
	output: #Image

	echo: string

	_run: #Run & {
		"input": input
		cmd: {
			name: "echo"
			args: [echo]
		}
	}

	output: _run.output
}

dagger.#Plan & {
	actions: build: docker.#Build & {
		steps: [
			docker.#Pull & {source:   "alpine"},
			#TestStep & {echo: "foo"},
			#TestStep & {echo: "bar"},
		]
	}
}

Fails with:

4:44PM FTL system | failed to load plan: actions.build._dag."1".output: 1 errors in empty disjunction::
    /Users/al/work/dagger/pkg/universe.dagger.io/docker/build.cue:22:10

However, changing #TestStep._run to #TestStep.run works.

Added as a (failing) test case: https://github.com/dagger/dagger/pull/1471