I'm trying to
- Load data into the container with
with_directory() - Run some command (eg compile)
- Get the results of the command with
directory()/glob()
But I'm getting exceptions where it looks like the path being generated by the glob() command is duplicating the path, something like "lstat /tmp/buildkit-mount2203948190/SOME_DIR/SOME_DIR: no such file or directory". Here is a super cut down example demonstrating the problem:
import sys
import anyio
import dagger
async def main():
async with dagger.Connection(dagger.Config(log_output=sys.stderr)) as client:
build_directory = client.host().directory(".")
ctr = await (
client
.container()
.from_("busybox")
.with_directory("/build", build_directory)
.with_exec(["echo", "hello world"], redirect_stdout="/build/output.txt")
)
output_directory = ctr.directory("/build")
for filename in await output_directory.glob("**/*.txt"):
print(filename)
anyio.run(main)