Remove build dirs from docker image to keep the layers small (#5243)
* Remove build dirs from docker image to keep the layers small * Create setup_docker_prereqs script to prepare docker env * Add documentation for required packages, drop colorlog and cython in first step of Dockerfile since it will be installed later on anyway. Drop libglib2.0-dev and libbluetooth-dev * Also remove early install of colorlog and cython in Dockerfile.dev * Re-add libglib2.0-dev and libbluetooth-dev for Bluetooth LE
This commit is contained in:
committed by
Paulus Schoutsen
parent
7ed83306ea
commit
d4eabaf844
@@ -10,24 +10,11 @@ VOLUME /config
|
||||
RUN mkdir -p /usr/src/app
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
RUN pip3 install --no-cache-dir colorlog cython
|
||||
|
||||
# For the nmap tracker, bluetooth tracker, Z-Wave, tellstick
|
||||
RUN echo "deb http://download.telldus.com/debian/ stable main" >> /etc/apt/sources.list.d/telldus.list && \
|
||||
wget -qO - http://download.telldus.se/debian/telldus-public.key | apt-key add - && \
|
||||
apt-get update && \
|
||||
apt-get install -y --no-install-recommends nmap net-tools cython3 libudev-dev sudo libglib2.0-dev bluetooth libbluetooth-dev \
|
||||
libtelldus-core2 cmake libxrandr-dev swig && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
COPY script/build_python_openzwave script/build_python_openzwave
|
||||
RUN script/build_python_openzwave && \
|
||||
mkdir -p /usr/local/share/python-openzwave && \
|
||||
ln -sf /usr/src/app/build/python-openzwave/openzwave/config /usr/local/share/python-openzwave/config
|
||||
|
||||
COPY script/build_libcec script/build_libcec
|
||||
RUN script/build_libcec
|
||||
# Copy build scripts
|
||||
COPY script/setup_docker_prereqs script/build_python_openzwave script/build_libcec script/
|
||||
RUN script/setup_docker_prereqs
|
||||
|
||||
# Install hass component dependencies
|
||||
COPY requirements_all.txt requirements_all.txt
|
||||
RUN pip3 install --no-cache-dir -r requirements_all.txt && \
|
||||
pip3 install --no-cache-dir mysqlclient psycopg2 uvloop
|
||||
@@ -42,13 +29,10 @@ RUN curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash - && \
|
||||
RUN pip3 install --no-cache-dir tox
|
||||
|
||||
# Copy over everything required to run tox
|
||||
COPY requirements_test.txt .
|
||||
COPY setup.cfg .
|
||||
COPY setup.py .
|
||||
COPY tox.ini .
|
||||
COPY requirements_test.txt setup.cfg setup.py tox.ini ./
|
||||
COPY homeassistant/const.py homeassistant/const.py
|
||||
|
||||
# Get all dependencies
|
||||
# Prefetch dependencies for tox
|
||||
RUN tox -e py35 --notest
|
||||
|
||||
# END: Development additions
|
||||
|
||||
Reference in New Issue
Block a user