Skip to content

Exec exit code is not bubbled up? #74

Closed

Description

@dubo-dubon-duponey

Consider:

package testing

#dagger: compute: [
	{
		do:  "fetch-container"
		ref: "alpine"
	},
	{
		do: "exec"
		args: ["sh", "-c", "exit 123"]
		dir: "/"
	},
]

dagger will exit with 1 (and not 123).

Unless there is a reason not to that I missed, IMHO dagger should bubble up the exit code, and exit with whatever the script returned.

This will also incidentally make integration testing much easier - in a context where execs may or may not run depending on concreteness.

Activity

  1. added
    kind/bug
    on Jan 26, 2021
  2. aluzzardi commented on Mar 2, 2021

    @aluzzardi
    Contributor

    The underlying issue is that the exit code is not bubbled up by buildkit. To support this, we could either inject a custom entrypoint in the container or find a way to bubble it up from buildkit.

    Re-categorizing as an enhancement since it's not a bug, per se.

  3. added and removed
    kind/bug
    on Mar 2, 2021
  4. shykes commented on Feb 18, 2022

    @shykes
    Contributor

    Duplicate of #1245

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions