2 Commits

  1. 24
      precise/base-0k/hooks/install.d/00-base.sh
  2. 6
      precise/host/hooks/install.d/60-docker.sh
  3. 19
      precise/host/hooks/install.d/70-0k.sh

24
precise/base-0k/hooks/install.d/00-base.sh

@ -70,7 +70,31 @@ apt:update() {
/etc/apt/sources.list
#s,^(deb(-src)? http://deb.debian.org/debian '"$variant"'),#\1,' \
fi
if [[ " ${tried[*]} " != *" ${variant}-archive-comment-out "* ]] &&
[[ "$failed_fetch" == *" http://archive.debian.org/debian/dists/$variant/"* ]]; then
tried+=("${variant}-archive-comment-out")
[ -z "$backup" ] && {
backup=1
echo "Backup old /etc/apt/sources.list"
cp -v /etc/apt/sources.list{,.myc-update}
}
echo "Applying ${variant}-archive-comment-out"
sed -ri 's,^(deb(-src)? http://archive.debian.org/debian '"$variant"'),#\1,g' \
/etc/apt/sources.list
fi
done
if [[ " ${tried[*]} " != *" ${variant}-security-comment-out "* ]] &&
[[ "$failed_release" == *"'http://security.debian.org $distrib/updates "* ]]; then
tried+=("${distrib}-comment-out")
[ -z "$backup" ] && {
backup=1
echo "Backup old /etc/apt/sources.list"
cp -v /etc/apt/sources.list{,.myc-update}
}
echo "Applying $distrib}-comment-out"
sed -ri 's,^(deb(-src)? http://security.debian.org/ '"$distrib/updates"'),#\1,g' \
/etc/apt/sources.list
fi
done
if [[ " ${tried[*]} " != *" change-release-fix "* ]] &&

6
precise/host/hooks/install.d/60-docker.sh

@ -14,13 +14,17 @@ if [ "$exname" == "bash" ]; then
exit 1
fi
fi
for bin in apt-get grep dpkg file lsb_release; do
for bin in apt-get grep dpkg file lsb_release yq; do
if ! type -p "$bin" >/dev/null; then
echo "Error: \`\`$bin\`\` not found" >&2
exit 1
fi
done
##
## Install docker
##
STATIC_DOCKER_URL="https://download.docker.com/linux/static/stable/x86_64"
distro=$(lsb_release -is)

19
precise/host/hooks/install.d/70-0k.sh

@ -277,3 +277,22 @@ fi
apt-get install -y pv buffer < /dev/null
apt-get install -y postgresql-client </dev/null
)
##
## Limit docker log size
##
## XXXvlab: if file changed, it would be nice to reload daemon,
## as a starter, but containers will need to be re-created to
## take effect
touch /etc/docker/daemon.json &&
yq e -i '
.log-driver = "json-file",
.log-opts = {
"max-size": "10m",
"max-file": "5"
}
' /etc/docker/daemon.json || exit 1
Loading…
Cancel
Save