https://docs.astral.sh/uv/guides/scripts/#declaring-script-d...
Plus inline deps mean you can pin python versions and 3rd party modules using pyproject.toml syntax in a comment of your script. This is not perfect locking, as it doesn't pin sub dependencies, but it's already more that any other tool out there.
If you want perfect locking, create a project, and use uv lock. You are already in a different category of code.
Firecracker and gVisor provide much stronger isolation. Both are battle tested; clouds run millions of multi-tenant workloads on these every day. Docker would simply never even be a candidate for this purpose.
If you have a working docker escape exploit at hand, that works on unprivileged containers, you can earn some good money. Just saying.
Docker was not created as a sandbox, but people rely on it for security and it is a sandbox at this point. Hell, containerd is one of kuberbetes backends and it absolutely relies on it being a secure sandbox.
The solution, therefor, as always been to use the OS tooling for that. Even the .Net ecosystem eventually went into that direction.
The JS ecosystem is making that mistake right now, and will of course, deprecate this API in 10 years after they realize they can't make it secure either unless they basically reimplement BSD jails entirely.
devbox on MacOS.
distrobox/toolbx on Linux.
Project Bluefin has some really good ideas and concepts about all this: https://docs.projectbluefin.io/bluefin-dx/
So not sure it would necessarily be ergonomically worse. It could even be a new run command `uv srun` or something…
BiteCode_dev•6mo ago
No? Well, you can:
uv run https://pastebin.com/raw/RrEWSA5F
And since yesterday, you can even run a github gist:
uv run https://gist.github.com/charliermarsh/ea9eab7f56b1b3d41e5196...
unglaublich•6mo ago
> print("hi")' | uv run -
> curl https://pastebin.com/raw/RrEWSA5F | uv run -
abraham•6mo ago
https://gist.github.com/charliermarsh/ea9eab7f56b1b3d41e5196...
BiteCode_dev•6mo ago