Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
7ed8330
commit d4eabaf
Showing
4 changed files
with
61 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
# Install requirements and build dependencies for Home Assinstant in Docker. | ||
|
||
# Required debian packages for running hass or components | ||
PACKAGES=( | ||
# homeassistant.components.device_tracker.nmap_tracker | ||
nmap net-tools | ||
# homeassistant.components.device_tracker.bluetooth_tracker | ||
bluetooth libglib2.0-dev libbluetooth-dev | ||
# homeassistant.components.tellstick | ||
libtelldus-core2 | ||
) | ||
|
||
# Required debian packages for building dependencies | ||
PACKAGES_DEV=( | ||
# python-openzwave | ||
cython3 libudev-dev | ||
# libcec | ||
cmake swig libxrandr-dev | ||
) | ||
|
||
# Stop on errors | ||
set -e | ||
|
||
cd "$(dirname "$0")/.." | ||
|
||
# Add Tellstick repository | ||
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 - | ||
|
||
# Install packages | ||
apt-get update | ||
apt-get install -y --no-install-recommends ${PACKAGES[@]} ${PACKAGES_DEV[@]} | ||
|
||
# Build and install openzwave | ||
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 | ||
|
||
# Build and install libcec | ||
script/build_libcec | ||
|
||
# Remove packages | ||
apt-get remove -y --purge ${PACKAGES_DEV[@]} | ||
apt-get -y --purge autoremove | ||
|
||
# Cleanup | ||
apt-get clean | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* build/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters