Extend Docker build caching opportunities (#60661)
This commit is contained in:
parent
95286791fe
commit
b04b314a9b
2 changed files with 17 additions and 7 deletions
15
Dockerfile
15
Dockerfile
|
@ -7,12 +7,21 @@ ENV \
|
||||||
|
|
||||||
WORKDIR /usr/src
|
WORKDIR /usr/src
|
||||||
|
|
||||||
## Setup Home Assistant
|
## Setup Home Assistant Core dependencies
|
||||||
|
COPY requirements.txt homeassistant/
|
||||||
|
COPY homeassistant/package_constraints.txt homeassistant/homeassistant/
|
||||||
|
RUN \
|
||||||
|
pip3 install --no-cache-dir --no-index --only-binary=:all: --find-links "${WHEELS_LINKS}" \
|
||||||
|
-r homeassistant/requirements.txt
|
||||||
|
COPY requirements_all.txt homeassistant/
|
||||||
|
RUN \
|
||||||
|
pip3 install --no-cache-dir --no-index --only-binary=:all: --find-links "${WHEELS_LINKS}" \
|
||||||
|
-r homeassistant/requirements_all.txt
|
||||||
|
|
||||||
|
## Setup Home Assistant Core
|
||||||
COPY . homeassistant/
|
COPY . homeassistant/
|
||||||
RUN \
|
RUN \
|
||||||
pip3 install --no-cache-dir --no-index --only-binary=:all: --find-links "${WHEELS_LINKS}" \
|
pip3 install --no-cache-dir --no-index --only-binary=:all: --find-links "${WHEELS_LINKS}" \
|
||||||
-r homeassistant/requirements_all.txt \
|
|
||||||
&& pip3 install --no-cache-dir --no-index --only-binary=:all: --find-links "${WHEELS_LINKS}" \
|
|
||||||
-e ./homeassistant \
|
-e ./homeassistant \
|
||||||
&& python3 -m compileall homeassistant/homeassistant
|
&& python3 -m compileall homeassistant/homeassistant
|
||||||
|
|
||||||
|
|
|
@ -30,11 +30,12 @@ RUN git clone --depth 1 https://github.com/home-assistant/hass-release \
|
||||||
WORKDIR /workspaces
|
WORKDIR /workspaces
|
||||||
|
|
||||||
# Install Python dependencies from requirements
|
# Install Python dependencies from requirements
|
||||||
COPY requirements.txt requirements_test.txt requirements_test_pre_commit.txt ./
|
COPY requirements.txt ./
|
||||||
COPY homeassistant/package_constraints.txt homeassistant/package_constraints.txt
|
COPY homeassistant/package_constraints.txt homeassistant/package_constraints.txt
|
||||||
RUN pip3 install -r requirements.txt \
|
RUN pip3 install -r requirements.txt
|
||||||
&& pip3 install -r requirements_test.txt \
|
COPY requirements_test.txt requirements_test_pre_commit.txt ./
|
||||||
&& rm -rf requirements.txt requirements_test.txt requirements_test_pre_commit.txt homeassistant/
|
RUN pip3 install -r requirements_test.txt
|
||||||
|
RUN rm -rf requirements.txt requirements_test.txt requirements_test_pre_commit.txt homeassistant/
|
||||||
|
|
||||||
# Set the default shell to bash instead of sh
|
# Set the default shell to bash instead of sh
|
||||||
ENV SHELL /bin/bash
|
ENV SHELL /bin/bash
|
||||||
|
|
Loading…
Add table
Reference in a new issue