mirror of
https://github.com/home-assistant/core.git
synced 2025-12-20 02:48:57 +00:00
Reduce Devcontainer docker layers (#157412)
This commit is contained in:
@@ -35,25 +35,22 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
|
|||||||
|
|
||||||
USER vscode
|
USER vscode
|
||||||
|
|
||||||
COPY .python-version ./
|
|
||||||
RUN uv python install
|
|
||||||
|
|
||||||
ENV VIRTUAL_ENV="/home/vscode/.local/ha-venv"
|
ENV VIRTUAL_ENV="/home/vscode/.local/ha-venv"
|
||||||
RUN uv venv $VIRTUAL_ENV
|
RUN --mount=type=bind,source=.python-version,target=.python-version \
|
||||||
|
uv python install \
|
||||||
|
&& uv venv $VIRTUAL_ENV
|
||||||
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
||||||
|
|
||||||
WORKDIR /tmp
|
|
||||||
|
|
||||||
# Setup hass-release
|
# Setup hass-release
|
||||||
RUN git clone --depth 1 https://github.com/home-assistant/hass-release ~/hass-release \
|
RUN git clone --depth 1 https://github.com/home-assistant/hass-release ~/hass-release \
|
||||||
&& uv pip install -e ~/hass-release/
|
&& uv pip install -e ~/hass-release/
|
||||||
|
|
||||||
# Install Python dependencies from requirements
|
# Install Python dependencies from requirements
|
||||||
COPY requirements.txt ./
|
RUN --mount=type=bind,source=requirements.txt,target=requirements.txt \
|
||||||
COPY homeassistant/package_constraints.txt homeassistant/package_constraints.txt
|
--mount=type=bind,source=homeassistant/package_constraints.txt,target=homeassistant/package_constraints.txt \
|
||||||
RUN uv pip install -r requirements.txt
|
--mount=type=bind,source=requirements_test.txt,target=requirements_test.txt \
|
||||||
COPY requirements_test.txt requirements_test_pre_commit.txt ./
|
--mount=type=bind,source=requirements_test_pre_commit.txt,target=requirements_test_pre_commit.txt \
|
||||||
RUN uv pip install -r requirements_test.txt
|
uv pip install -r requirements.txt -r requirements_test.txt
|
||||||
|
|
||||||
WORKDIR /workspaces
|
WORKDIR /workspaces
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user