Use more layer caching for esphome/esphome Dockerfile (#1150)

This commit is contained in:
Otto Winter 2020-07-15 15:03:15 +02:00 committed by GitHub
parent b6394b7c6d
commit dcadcdf056
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 7 deletions

View file

@ -187,7 +187,7 @@ jobs:
echo "::set-env name=TAG::${TAG}" echo "::set-env name=TAG::${TAG}"
- name: Set up env variables - name: Set up env variables
run: | run: |
base_version="2.3.1" base_version="2.3.3"
if [[ "${{ matrix.build_type }}" == "hassio" ]]; then if [[ "${{ matrix.build_type }}" == "hassio" ]]; then
build_from="esphome/esphome-hassio-base-${{ matrix.arch }}:${base_version}" build_from="esphome/esphome-hassio-base-${{ matrix.arch }}:${base_version}"

View file

@ -206,7 +206,7 @@ jobs:
echo "::set-env name=TAG::${TAG}" echo "::set-env name=TAG::${TAG}"
- name: Set up env variables - name: Set up env variables
run: | run: |
base_version="2.3.1" base_version="2.3.3"
if [[ "${{ matrix.build_type }}" == "hassio" ]]; then if [[ "${{ matrix.build_type }}" == "hassio" ]]; then
build_from="esphome/esphome-hassio-base-${{ matrix.arch }}:${base_version}" build_from="esphome/esphome-hassio-base-${{ matrix.arch }}:${base_version}"

View file

@ -1,12 +1,21 @@
ARG BUILD_FROM=esphome/esphome-base-amd64:2.3.1 ARG BUILD_FROM=esphome/esphome-base-amd64:2.3.3
FROM ${BUILD_FROM} FROM ${BUILD_FROM}
# First install requirements to leverage caching when requirements don't change
COPY requirements.txt /
RUN pip3 install --no-cache-dir -r /requirements.txt
# Then copy esphome and install
COPY . . COPY . .
RUN pip3 install --no-cache-dir -e . RUN pip3 install --no-cache-dir -e .
ENV USERNAME="" # Settings for dashboard
ENV PASSWORD="" ENV USERNAME="" PASSWORD=""
# The directory the user should mount their configuration files to
WORKDIR /config WORKDIR /config
# Set entrypoint to esphome so that the user doesn't have to type 'esphome'
# in every docker command twice
ENTRYPOINT ["esphome"] ENTRYPOINT ["esphome"]
# When no arguments given, start the dashboard in the workdir
CMD ["/config", "dashboard"] CMD ["/config", "dashboard"]

View file

@ -1,4 +1,4 @@
FROM esphome/esphome-base-amd64:2.3.1 FROM esphome/esphome-base-amd64:2.3.3
COPY . . COPY . .

View file

@ -1,4 +1,4 @@
FROM esphome/esphome-lint-base:2.3.1 FROM esphome/esphome-lint-base:2.3.3
COPY requirements.txt requirements_test.txt / COPY requirements.txt requirements_test.txt /
RUN pip3 install --no-cache-dir -r /requirements.txt -r /requirements_test.txt RUN pip3 install --no-cache-dir -r /requirements.txt -r /requirements_test.txt