We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm supposed to be able to do this:
dag.Container().WithFile("", file) dag.Directory().WithFile("", file)
When no path is specified, the file should be mounted in the current directory with it's current name.
Unfortunately, Dagger behaves differently in different scenarios which makes mounting files like this unreliable.
(The unfortunate consequence is every higher level API that allows mounting a file in a lower level container requires a second name parameter too)
dagger v0.11.4 (registry.dagger.io/engine) darwin/arm64
package main type Repro struct{} func (m *Repro) EmptyDir() *Container { dir := dag.Directory(). WithDirectory("bar", dag.Directory().WithFile("", dag.CurrentModule().Source().File("baz.conf"))) return dag.Container(). From("cgr.dev/chainguard/wolfi-base"). WithDirectory("/etc/foo", dir). WithExec([]string{"tree", "/etc/foo"}) } func (m *Repro) Dir() *Container { dir := dag.Directory(). WithDirectory("bar", dag.Directory()) dir2 := dir.Directory("bar").WithFile("", dag.CurrentModule().Source().File("baz.conf")) dir = dir.WithDirectory("bar", dir2) return dag.Container(). From("cgr.dev/chainguard/wolfi-base"). WithDirectory("/etc/foo", dir). WithExec([]string{"tree", "/etc/foo"}) } func (m *Repro) Ctr() *Container { dir := dag.Directory(). WithDirectory("bar", dag.Directory()) ctr := dag.Container(). From("cgr.dev/chainguard/wolfi-base"). WithDirectory("/etc/foo", dir). WithExec([]string{"tree", "/etc/foo"}) dir2 := ctr.Directory("/etc/foo/bar").WithFile("", dag.CurrentModule().Source().File("baz.conf")) return ctr.WithDirectory("/etc/foo/bar", dir2) } func (m *Repro) Ctr2() *Container { return dag.Container(). From("cgr.dev/chainguard/wolfi-base"). WithFile("/etc/foo/bar/", dag.CurrentModule().Source().File("baz.conf")). WithExec([]string{"tree", "/etc/foo"}) } func (m *Repro) File(path *File) *Container { return dag.Container(). From("cgr.dev/chainguard/wolfi-base"). WithFile("/etc/foo/bar/", path). WithExec([]string{"tree", "/etc/foo"}) }
touch baz.conf
dagger call empty-dir stdout dagger call dir stdout dagger call ctr stdout dagger call ctr2 stdout dagger call file --path ./baz.conf stdout nix run github:dagger/nix#dagger -- call empty-dir stdout nix run github:dagger/nix#dagger -- call dir stdout nix run github:dagger/nix#dagger -- call ctr stdout nix run github:dagger/nix#dagger -- call ctr2 stdout nix run github:dagger/nix#dagger -- call file --path ./baz.conf stdout
dagger call empty-dir stdout /etc/foo `-- bar `-- baz.conf 1 directories, 1 files dagger call dir stdout /etc/foo `-- bar 0 directories, 1 files dagger call ctr stdout /etc/foo `-- bar 1 directories, 0 files dagger call ctr2 stdout /etc/foo `-- bar `-- bar 1 directories, 1 files dagger call file --path ./baz.conf stdout /etc/foo `-- bar `-- bar 1 directories, 1 files
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What is the issue?
I'm supposed to be able to do this:
When no path is specified, the file should be mounted in the current directory with it's current name.
Unfortunately, Dagger behaves differently in different scenarios which makes mounting files like this unreliable.
(The unfortunate consequence is every higher level API that allows mounting a file in a lower level container requires a second name parameter too)
Dagger version
dagger v0.11.4 (registry.dagger.io/engine) darwin/arm64
Steps to reproduce
Log output
The text was updated successfully, but these errors were encountered: