Apply approach to allow for minimal builds
This commit is contained in:
@@ -5,7 +5,7 @@ FILE = $(DIR)/Dockerfile
|
|||||||
FROM = ubuntu:trusty
|
FROM = ubuntu:trusty
|
||||||
PORT = 8001
|
PORT = 8001
|
||||||
MODE = minimal
|
MODE = minimal
|
||||||
ARGS = --no-cache
|
ARGS = --no-cache --rm=true
|
||||||
|
|
||||||
include $(wildcard $(HOME)/build/make/*.mk)
|
include $(wildcard $(HOME)/build/make/*.mk)
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ build: prepare
|
|||||||
$(call script,cleanup)
|
$(call script,cleanup)
|
||||||
@echo 'CMD ["/opt/init"]' >> ${FILE}
|
@echo 'CMD ["/opt/init"]' >> ${FILE}
|
||||||
@$(shell cd ${BASE} && python -m SimpleHTTPServer $(PORT) > /dev/null &)
|
@$(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)
|
@kill -9 $(lsof -i tcp:8001 -t)
|
||||||
|
|
||||||
prepare:
|
prepare:
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ export LC_ALL=C
|
|||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
apt_get_install='apt-get install -y --no-install-recommends'
|
apt_get_install='apt-get install -y --no-install-recommends'
|
||||||
minimal_apt_get_install=$apt_get_install
|
|
||||||
|
|
||||||
apt_get_install_permanent() {
|
apt_get_install_permanent() {
|
||||||
echo $@ >> /build/permanent
|
echo $@ >> /build/permanent
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
base: cron syslog sshd hosts
|
base: cron syslog sshd hosts
|
||||||
# $(call script,boot)
|
$(call script,init)
|
||||||
# $(call script,init)
|
$(call script,runit)
|
||||||
# $(call script,runit)
|
$(call script,logrotate)
|
||||||
# $(call script,logrotate)
|
$(call script,utilities)
|
||||||
# $(call script,utilities)
|
|
||||||
@@ -4,7 +4,7 @@ source /build/config
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
## Chrome dependencies
|
## 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
|
## Chrome
|
||||||
mkdir -p /usr/share/icons/hicolor
|
mkdir -p /usr/share/icons/hicolor
|
||||||
|
|||||||
@@ -3,10 +3,14 @@ set -e
|
|||||||
source /build/config
|
source /build/config
|
||||||
set -x
|
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
|
apt-get clean
|
||||||
# rm -rf /build
|
rm -rf /build
|
||||||
rm -rf /tmp/* /var/tmp/*
|
rm -rf /tmp/* /var/tmp/*
|
||||||
# rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
# rm -f /etc/dpkg/dpkg.cfg.d/02apt-speedup
|
rm -f /etc/dpkg/dpkg.cfg.d/02apt-speedup
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ source /build/config
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
## Often used tools
|
## Often used tools
|
||||||
$minimal_apt_get_install gcc make automake libtool
|
apt_get_install_temporary gcc make automake libtool
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ source /build/config
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
## Chrome dependencies
|
## Chrome dependencies
|
||||||
$minimal_apt_get_install firefox
|
apt_get_install_permanent firefox
|
||||||
|
|
||||||
## Pulseaudio script
|
## Pulseaudio script
|
||||||
echo "PULSE_SERVER=host firefox" > /opt/firefox
|
echo "PULSE_SERVER=host firefox" > /opt/firefox
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ source /build/config
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
# GMediaRender dependencies
|
# 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-base gstreamer0.10-plugins-good \
|
||||||
gstreamer0.10-plugins-bad gstreamer0.10-plugins-ugly \
|
gstreamer0.10-plugins-bad gstreamer0.10-plugins-ugly \
|
||||||
gstreamer0.10-ffmpeg \
|
gstreamer0.10-ffmpeg \
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ source /build/config
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
## Hamachi dependency
|
## Hamachi dependency
|
||||||
$minimal_apt_get_install lsb-core net-tools socat strace
|
apt_get_install_permanent lsb-core net-tools socat strace
|
||||||
|
|
||||||
## Hamachi
|
## Hamachi
|
||||||
cd /opt
|
cd /opt
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ source /build/config
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
## Install logrotate
|
## Install logrotate
|
||||||
$minimal_apt_get_install logrotate
|
apt_get_install_permanent logrotate
|
||||||
@@ -4,7 +4,7 @@ source /build/config
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
# MiniDLNA dependencies
|
# 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_VERSION=1.1.1
|
||||||
export MINIDLNA_CONFIG=/host/etc/minidlna.conf
|
export MINIDLNA_CONFIG=/host/etc/minidlna.conf
|
||||||
|
|||||||
@@ -31,13 +31,13 @@ dpkg-divert --local --rename --add /usr/bin/ischroot
|
|||||||
ln -sf /bin/true /usr/bin/ischroot
|
ln -sf /bin/true /usr/bin/ischroot
|
||||||
|
|
||||||
## Install HTTPS support for APT
|
## Install HTTPS support for APT
|
||||||
$minimal_apt_get_install apt-transport-https
|
apt_get_install_permanent apt-transport-https
|
||||||
|
|
||||||
## Upgrade all packages
|
## Upgrade all packages
|
||||||
apt-get dist-upgrade -y --no-install-recommends
|
#apt-get dist-upgrade -y --no-install-recommends
|
||||||
|
|
||||||
## Fix locale
|
## Fix locale
|
||||||
$minimal_apt_get_install language-pack-en
|
apt_get_install_permanent language-pack-en
|
||||||
locale-gen en_US
|
locale-gen en_US
|
||||||
|
|
||||||
## Create directory for boot scripts
|
## Create directory for boot scripts
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ source /build/config
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
## Pulseaudio
|
## Pulseaudio
|
||||||
$minimal_apt_get_install pulseaudio
|
apt_get_install_permanent pulseaudio
|
||||||
|
|
||||||
## Setup environment
|
## Setup environment
|
||||||
sed -i "1iexport PULSE_SERVER=host" /root/.profile
|
sed -i "1iexport PULSE_SERVER=host" /root/.profile
|
||||||
@@ -4,7 +4,7 @@ source /build/config
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
## Redis
|
## Redis
|
||||||
$minimal_apt_get_install redis-server
|
apt_get_install_permanent redis-server
|
||||||
|
|
||||||
export REDIS_CONFIG=/etc/redis/redis.conf
|
export REDIS_CONFIG=/etc/redis/redis.conf
|
||||||
export REDIS_LOG=/host/var/log/redis/redis.log
|
export REDIS_LOG=/host/var/log/redis/redis.log
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ source /build/config
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
## Install runit
|
## Install runit
|
||||||
$minimal_apt_get_install runit
|
apt_get_install_permanent runit
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ source /build/config
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
## Install the SSH server
|
## Install the SSH server
|
||||||
$minimal_apt_get_install openssh-server
|
apt_get_install_permanent openssh-server
|
||||||
mkdir /var/run/sshd
|
mkdir /var/run/sshd
|
||||||
|
|
||||||
## Install root key
|
## Install root key
|
||||||
@@ -19,7 +19,7 @@ ssh-keygen -t rsa -N "" -f id_rsa
|
|||||||
cat /opt/id_rsa.pub >> "$AUTHORIZED_KEYS"
|
cat /opt/id_rsa.pub >> "$AUTHORIZED_KEYS"
|
||||||
|
|
||||||
## X11 forwarding
|
## X11 forwarding
|
||||||
$minimal_apt_get_install xauth
|
apt_get_install_permanent xauth
|
||||||
|
|
||||||
## Setup environment
|
## Setup environment
|
||||||
sed -i "1iexport HOME=/root" /root/.profile
|
sed -i "1iexport HOME=/root" /root/.profile
|
||||||
|
|||||||
@@ -4,6 +4,6 @@ source /build/config
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
## Install a syslog daemon
|
## Install a syslog daemon
|
||||||
$minimal_apt_get_install syslog-ng-core
|
apt_get_install_permanent syslog-ng-core
|
||||||
mkdir -p /var/lib/syslog-ng
|
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
|
sed -i "s/^\(#SYSLOGNG_OPTS=\).*$/\1\"--no-caps --default-modules=affile,afprog,afsocket,afuser,basicfuncs,csvparser,dbparser,syslogformat\"/" /etc/default/syslog-ng
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ source /build/config
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
## UPnP Proxy dependency
|
## UPnP Proxy dependency
|
||||||
$minimal_apt_get_install uuid-dev
|
apt_get_install_permanent uuid-dev
|
||||||
|
|
||||||
## UPnP Proxy
|
## UPnP Proxy
|
||||||
cd opt
|
cd opt
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ source /build/config
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
## Often used tools
|
## 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
|
## Often used python modules
|
||||||
pip install argparse
|
pip install argparse
|
||||||
|
|||||||
Reference in New Issue
Block a user