Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm well aware of `COPY --link`, it doesn't solve the problem. I'm a heavy heavy user of it, combined with throwaway build stages. `COPY --link` won't help my `apt install` commands.

The use case here isn't `FROM python:3.10`, it's `FROM ubuntu; RUN apt install -y vim wget curl software-properties-common python3.10`/`RUN rosdep install`/`RUN --mount=type=cache,target=/root/.cache/uv --mount=type=bind,source=uv.lock,target=uv.lock --mount=type=bind,source=pyproject.toml,target=pyproject.toml uv sync --locked --no-install-project`. All of those dependencies get merged onto a single layer that isn't shared with anything else. You'd better hope something like tensorflow isn't one of those dependencies.



Meta: I think your example code would benefit from being a code block; in HN this is done by prefixing with 2 spaces.

eg.

  FROM ubuntu
  RUN apt install -y vim wget curl software-properties-common python3.10
  RUN rosdep install
  RUN --mount=type=cache,target=/root/.cache/uv --mount=type=bind,source=uv.lock,target=uv.lock --mount=type=bind,source=pyproject.toml,target=pyproject.toml uv sync --locked --no-install-project


They were intended to be three separate examples but point taken, yes, I should have




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: