Hi all
I'm trying to reformat my Python codebase using Ruff and after several attempts, here is my current function:
async def __python(self) -> str | None:
return await (
dag.container()
.from_("python:3.13-slim")
.with_exec(["pip", "install", "ruff"])
.with_mounted_directory("/app/src", self.source)
.with_mounted_directory("/app/config", self.config)
.with_workdir("/app/src")
.with_exec(
["ruff", "format", "--config", "/app/config/pyproject.toml", "."]
)
.terminal()
.stdout()
)
I've added .terminal() so I can jump in the terminal and do a catof my script and I can confirm that Ruff has well done the reformat job. Nice! but ...
The updated file isn't synchronized with my host.
Still using the terminal (.terminal()), I do a touch TEST_RUFF to create that file and I can see it still in the terminal but that file is not created on my host.
I'm using Docker compose and my yaml file contains this line so, yeah, my current folder is well synchronized with the container.
volumes:
- ./..:/app
By running touch TEST_HOST on my host, I can well see the file in my container. It seems that the container created by dagger isn't synchronized in my case.
Did you know what I'm doing wrong ?
Also: in my .terminal() session, the current user is root (id 0 gid 0) while this is not the one in my Docker container (1000:1000); how can I tell dagger I want to use mine and not root?
Many, many thanks