Apply approach to allow for minimal builds

This commit is contained in:
2014-12-27 12:38:40 +01:00
parent 883a189597
commit dd680ef5fc
19 changed files with 32 additions and 30 deletions

View File

@@ -5,7 +5,7 @@ FILE = $(DIR)/Dockerfile
FROM = ubuntu:trusty
PORT = 8001
MODE = minimal
ARGS = --no-cache
ARGS = --no-cache --rm=true
include $(wildcard $(HOME)/build/make/*.mk)
@@ -36,7 +36,7 @@ build: prepare
$(call script,cleanup)
@echo 'CMD ["/opt/init"]' >> ${FILE}
@$(shell cd ${BASE} && python -m SimpleHTTPServer $(PORT) > /dev/null &)
@docker build -t $(NAME):$(VERSION) --rm=true $(ARGS) ${DIR}
@docker build -t $(NAME):$(VERSION) $(ARGS) ${DIR}
@kill -9 $(lsof -i tcp:8001 -t)
prepare:

View File

@@ -2,7 +2,6 @@ export LC_ALL=C
export DEBIAN_FRONTEND=noninteractive
apt_get_install='apt-get install -y --no-install-recommends'
minimal_apt_get_install=$apt_get_install
apt_get_install_permanent() {
echo $@ >> /build/permanent

View File

@@ -1,6 +1,5 @@
base: cron syslog sshd hosts
# $(call script,boot)
# $(call script,init)
# $(call script,runit)
# $(call script,logrotate)
# $(call script,utilities)
$(call script,init)
$(call script,runit)
$(call script,logrotate)
$(call script,utilities)

View File

@@ -4,7 +4,7 @@ source /build/config
set -x
## Chrome dependencies
$minimal_apt_get_install gconf-service libasound2 libatk1.0-0 libcairo2 libcap2 libcups2 libcurl3 libfontconfig1 libgdk-pixbuf2.0-0 libgtk2.0-0 libnspr4 libnss3 libpango1.0-0 librtmp0 libxss1 libxtst6 xdg-utils
apt_get_install_permanent gconf-service libasound2 libatk1.0-0 libcairo2 libcap2 libcups2 libcurl3 libfontconfig1 libgdk-pixbuf2.0-0 libgtk2.0-0 libnspr4 libnss3 libpango1.0-0 librtmp0 libxss1 libxtst6 xdg-utils
## Chrome
mkdir -p /usr/share/icons/hicolor

View File

@@ -3,10 +3,14 @@ set -e
source /build/config
set -x
## Remove temporary packages for minimal builds
if [ $MODE == "minimal" ]; then
cat /build/temporary | xargs apt-get -y autoremove
fi
echo $MODE
## Clean apt files
apt-get clean
# rm -rf /build
rm -rf /build
rm -rf /tmp/* /var/tmp/*
# rm -rf /var/lib/apt/lists/*
# rm -f /etc/dpkg/dpkg.cfg.d/02apt-speedup
rm -rf /var/lib/apt/lists/*
rm -f /etc/dpkg/dpkg.cfg.d/02apt-speedup

View File

@@ -4,4 +4,4 @@ source /build/config
set -x
## Often used tools
$minimal_apt_get_install gcc make automake libtool
apt_get_install_temporary gcc make automake libtool

View File

@@ -4,7 +4,7 @@ source /build/config
set -x
## Chrome dependencies
$minimal_apt_get_install firefox
apt_get_install_permanent firefox
## Pulseaudio script
echo "PULSE_SERVER=host firefox" > /opt/firefox

View File

@@ -4,7 +4,7 @@ source /build/config
set -x
# GMediaRender dependencies
$minimal_apt_get_install libupnp-dev libgstreamer0.10-dev \
apt_get_install_permanent libupnp-dev libgstreamer0.10-dev \
gstreamer0.10-plugins-base gstreamer0.10-plugins-good \
gstreamer0.10-plugins-bad gstreamer0.10-plugins-ugly \
gstreamer0.10-ffmpeg \

View File

@@ -4,7 +4,7 @@ source /build/config
set -x
## Hamachi dependency
$minimal_apt_get_install lsb-core net-tools socat strace
apt_get_install_permanent lsb-core net-tools socat strace
## Hamachi
cd /opt

View File

@@ -4,4 +4,4 @@ source /build/config
set -x
## Install logrotate
$minimal_apt_get_install logrotate
apt_get_install_permanent logrotate

View File

@@ -4,7 +4,7 @@ source /build/config
set -x
# MiniDLNA dependencies
$minimal_apt_get_install gettext libavutil-dev libavcodec-dev libavformat-dev libjpeg-dev libsqlite3-dev libexif-dev libid3tag0-dev libogg-dev libvorbis-dev libFLAC-dev
apt_get_install_permanent gettext libavutil-dev libavcodec-dev libavformat-dev libjpeg-dev libsqlite3-dev libexif-dev libid3tag0-dev libogg-dev libvorbis-dev libFLAC-dev
export MINIDLNA_VERSION=1.1.1
export MINIDLNA_CONFIG=/host/etc/minidlna.conf

View File

@@ -31,13 +31,13 @@ dpkg-divert --local --rename --add /usr/bin/ischroot
ln -sf /bin/true /usr/bin/ischroot
## Install HTTPS support for APT
$minimal_apt_get_install apt-transport-https
apt_get_install_permanent apt-transport-https
## Upgrade all packages
apt-get dist-upgrade -y --no-install-recommends
#apt-get dist-upgrade -y --no-install-recommends
## Fix locale
$minimal_apt_get_install language-pack-en
apt_get_install_permanent language-pack-en
locale-gen en_US
## Create directory for boot scripts

View File

@@ -4,7 +4,7 @@ source /build/config
set -x
## Pulseaudio
$minimal_apt_get_install pulseaudio
apt_get_install_permanent pulseaudio
## Setup environment
sed -i "1iexport PULSE_SERVER=host" /root/.profile

View File

@@ -4,7 +4,7 @@ source /build/config
set -x
## Redis
$minimal_apt_get_install redis-server
apt_get_install_permanent redis-server
export REDIS_CONFIG=/etc/redis/redis.conf
export REDIS_LOG=/host/var/log/redis/redis.log

View File

@@ -4,4 +4,4 @@ source /build/config
set -x
## Install runit
$minimal_apt_get_install runit
apt_get_install_permanent runit

View File

@@ -4,7 +4,7 @@ source /build/config
set -x
## Install the SSH server
$minimal_apt_get_install openssh-server
apt_get_install_permanent openssh-server
mkdir /var/run/sshd
## Install root key
@@ -19,7 +19,7 @@ ssh-keygen -t rsa -N "" -f id_rsa
cat /opt/id_rsa.pub >> "$AUTHORIZED_KEYS"
## X11 forwarding
$minimal_apt_get_install xauth
apt_get_install_permanent xauth
## Setup environment
sed -i "1iexport HOME=/root" /root/.profile

View File

@@ -4,6 +4,6 @@ source /build/config
set -x
## Install a syslog daemon
$minimal_apt_get_install syslog-ng-core
apt_get_install_permanent syslog-ng-core
mkdir -p /var/lib/syslog-ng
sed -i "s/^\(#SYSLOGNG_OPTS=\).*$/\1\"--no-caps --default-modules=affile,afprog,afsocket,afuser,basicfuncs,csvparser,dbparser,syslogformat\"/" /etc/default/syslog-ng

View File

@@ -4,7 +4,7 @@ source /build/config
set -x
## UPnP Proxy dependency
$minimal_apt_get_install uuid-dev
apt_get_install_permanent uuid-dev
## UPnP Proxy
cd opt

View File

@@ -4,7 +4,7 @@ source /build/config
set -x
## Often used tools
$minimal_apt_get_install wget curl python-pip git inetutils-ping telnet
apt_get_install_temporary curl python-pip git inetutils-ping telnet
## Often used python modules
pip install argparse