diff --git a/src/bentoml/_internal/container/frontend/dockerfile/templates/base.j2 b/src/bentoml/_internal/container/frontend/dockerfile/templates/base.j2 index 8c5c16f9544..dc819488ee8 100644 --- a/src/bentoml/_internal/container/frontend/dockerfile/templates/base.j2 +++ b/src/bentoml/_internal/container/frontend/dockerfile/templates/base.j2 @@ -62,7 +62,7 @@ WORKDIR $BENTO_PATH # Block SETUP_BENTO_COMPONENTS {% block SETUP_BENTO_COMPONENTS %} -RUN uv venv -p {{ __options__python_version }} /app/.venv +RUN pip install uv && UV_PYTHON_INSTALL_DIR=/app/python/ uv venv {% if __options__python_version %}-p {{ __options__python_version }}{% endif %} /app/.venv ENV VIRTUAL_ENV=/app/.venv {% set __pip_cache__ = common.mount_cache("/root/.cache/uv") %} diff --git a/src/bentoml/_internal/container/frontend/dockerfile/templates/base_alpine.j2 b/src/bentoml/_internal/container/frontend/dockerfile/templates/base_alpine.j2 index 9154de94166..fa4eca8b9c5 100644 --- a/src/bentoml/_internal/container/frontend/dockerfile/templates/base_alpine.j2 +++ b/src/bentoml/_internal/container/frontend/dockerfile/templates/base_alpine.j2 @@ -8,9 +8,6 @@ ENV ENV /root/.bashrc -RUN curl -LO https://astral.sh/uv/install.sh && \ - sh install.sh && rm install.sh && mv $HOME/.local/bin/uv /usr/local/bin/ - {% if __options__system_packages is not none %} # Install user-defined system package {% call common.RUN(__enable_buildkit__) -%} {{ common.mount_cache("/var/cache/apk") }} {% endcall -%} set -eux \ diff --git a/src/bentoml/_internal/container/frontend/dockerfile/templates/base_amazonlinux.j2 b/src/bentoml/_internal/container/frontend/dockerfile/templates/base_amazonlinux.j2 index 2f243753c85..4345d75611a 100644 --- a/src/bentoml/_internal/container/frontend/dockerfile/templates/base_amazonlinux.j2 +++ b/src/bentoml/_internal/container/frontend/dockerfile/templates/base_amazonlinux.j2 @@ -12,9 +12,6 @@ USER root amazon-linux-extras enable python{{ __options__python_version }} && \ yum install -y python{{ __options__python_version.split(".") | join('') }} python{{ __options__python_version.split(".") | join('') }}-devel && \ yum groupinstall -y "Development Tools" - -RUN curl -LO https://astral.sh/uv/install.sh && \ - sh install.sh && rm install.sh && mv $HOME/.local/bin/uv /usr/local/bin/ {% if __options__system_packages is not none %} # Install user-defined system package {% call common.RUN(__enable_buildkit__) -%} {{ common.mount_cache("/var/cache/yum") }} {% endcall -%} set -eux && \ diff --git a/src/bentoml/_internal/container/frontend/dockerfile/templates/base_debian.j2 b/src/bentoml/_internal/container/frontend/dockerfile/templates/base_debian.j2 index a119a2c138a..70dd2e0f305 100644 --- a/src/bentoml/_internal/container/frontend/dockerfile/templates/base_debian.j2 +++ b/src/bentoml/_internal/container/frontend/dockerfile/templates/base_debian.j2 @@ -11,7 +11,4 @@ RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloa apt-get update -y && \ apt-get install -q -y --no-install-recommends --allow-remove-essential \ ca-certificates gnupg2 bash build-essential curl {% if __options__system_packages is not none %}{{ __options__system_packages | join(' ') }}{% endif %} - -RUN curl -LO https://astral.sh/uv/install.sh && \ - sh install.sh && rm install.sh && mv $HOME/.local/bin/uv /usr/local/bin/ {% endblock %} diff --git a/src/bentoml/_internal/container/frontend/dockerfile/templates/base_ubi8.j2 b/src/bentoml/_internal/container/frontend/dockerfile/templates/base_ubi8.j2 index 2fc12b58c8d..872dfabe373 100644 --- a/src/bentoml/_internal/container/frontend/dockerfile/templates/base_ubi8.j2 +++ b/src/bentoml/_internal/container/frontend/dockerfile/templates/base_ubi8.j2 @@ -6,9 +6,6 @@ USER root {% call common.RUN(__enable_buildkit__) -%} {{ common.mount_cache("/var/cache/yum") }} {% endcall -%} set -eux && \ yum upgrade -y \ && yum install -y ca-certificates curl gcc gcc-c++ make bash shadow-utils - -RUN curl -LO https://astral.sh/uv/install.sh && \ - sh install.sh && rm install.sh && mv $HOME/.local/bin/uv /usr/local/bin/ {% if __options__system_packages is not none %} # Install user-defined system package {% call common.RUN(__enable_buildkit__) -%} {{ common.mount_cache("/var/cache/yum") }} {% endcall -%} set -eux && \