So, pytorch requires a rather large bundle of packages. The prebuilt docker pytorch gpu images (https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/running.html) are quite helpful in this regard.
On the other hand, uv and its lockfile are also a very handy utility.
How to marry those two? I.e. I am looking for a dockerfile, which roughly looks like
FROM nvcr.io/nvidia/pytorch:<xx.xx>-py3
# more preparation ...
RUN uv sync --locked # does NOT fetch pytorch again
# some more preparation ...
CMD ["python", "-m", ""src.main:train_model"]
or, alternatively: Is it possible to tell uv somehow that some deps, albeit mentioned in the uv.lock, are provided by the global environment which provides python and pytorch?