Skip to content

Commit

Permalink
fix: copy uv from official docker image and freeze the version
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming committed Nov 27, 2024
1 parent 686c294 commit cdf083c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#
# ===========================================
{% endif %}
FROM ghcr.io/astral-sh/uv:0.5.4 as uv

# Block SETUP_BENTO_BASE_IMAGE
{% block SETUP_BENTO_BASE_IMAGE %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
ENV ENV /root/.bashrc

ENV UV_SYSTEM_PYTHON=1
RUN curl -LO https://astral.sh/uv/install.sh && \
sh install.sh && rm install.sh && mv $HOME/.local/bin/uv /usr/local/bin/
COPY --from=uv /uv /usr/local/bin/uv
COPY --from=uv /uvx /usr/local/bin/uvx

{% if __options__system_packages is not none %}
# Install user-defined system package
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ USER root
yum groupinstall -y "Development Tools"

ENV UV_SYSTEM_PYTHON=1
RUN curl -LO https://astral.sh/uv/install.sh && \
sh install.sh && rm install.sh && mv $HOME/.local/bin/uv /usr/local/bin/
COPY --from=uv /uv /usr/local/bin/uv
COPY --from=uv /uvx /usr/local/bin/uvx
{% 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 && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloa
ca-certificates gnupg2 bash build-essential curl {% if __options__system_packages is not none %}{{ __options__system_packages | join(' ') }}{% endif %}

ENV UV_SYSTEM_PYTHON=1
RUN curl -LO https://astral.sh/uv/install.sh && \
sh install.sh && rm install.sh && mv $HOME/.local/bin/uv /usr/local/bin/
COPY --from=uv /uv /usr/local/bin/uv
COPY --from=uv /uvx /usr/local/bin/uvx
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ USER root
&& yum install -y ca-certificates curl gcc gcc-c++ make bash shadow-utils

ENV UV_SYSTEM_PYTHON=1
RUN curl -LO https://astral.sh/uv/install.sh && \
sh install.sh && rm install.sh && mv $HOME/.local/bin/uv /usr/local/bin/
COPY --from=uv /uv /usr/local/bin/uv
COPY --from=uv /uvx /usr/local/bin/uvx
{% 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 && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#
# ===========================================
{% endif %}
FROM ghcr.io/astral-sh/uv:0.5.4 as uv

# Block SETUP_BENTO_BASE_IMAGE
{% block SETUP_BENTO_BASE_IMAGE %}
Expand Down Expand Up @@ -64,9 +65,9 @@ RUN command -v apt-get && apt-get update && apt-get -y install {{ required_packa
{% for command in __options__commands %}
RUN {{ command }}
{% endfor %}

RUN curl -LO https://astral.sh/uv/install.sh && \
sh install.sh && rm install.sh && mv $HOME/.local/bin/uv /usr/local/bin/ && uv venv --python {{ __options__python_version }}
COPY --from=uv /uv /usr/local/bin/uv
COPY --from=uv /uvx /usr/local/bin/uvx
RUN uv venv --python {{ __options__python_version }}
{% set __pip_cache__ = common.mount_cache("/root/.cache/") %}
{% if __pip_preheat_packages__ %}
{% for value in __pip_preheat_packages__ -%}
Expand Down

0 comments on commit cdf083c

Please sign in to comment.