Public | Automated Build

Last pushed: 2 years ago
Short Description
Ubuntu image with daily unattended upgrade for security updates
Full Description

docker-unattended-upgrade

Ubuntu image with daily unattended upgrade for security updates.

The image simply installs unattended-upgrade and supervisor with two simple scripts:

  1. install to configure supervisor to run cron
  2. start adds a cron job to call unattended-upgrade and start supervisor

This only to ensure that security updates are installed automatically in production untill a new update docker
image is pushed and deployed with latest security updates.

The image can be pulled from docker hub directly

docker run itech/base-unattended-upgrade

or used as a base image by defining the Dockerfile as following

FROM itech/base-unattended-upgrade
# Rest of your Dockerfile

The helper scripts are fairly simple:

install

#!/bin/bash
set -e

cat > /etc/supervisor/conf.d/cron.conf <<EOF
[program:cron]
priority=20
directory=/tmp
command=/usr/sbin/cron -f
user=root
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
EOF

rm -rf /var/lib/apt/lists/*

start

#!/bin/bash

set -e

echo "Adding crontab for unattended-upgrade ..."
echo "0 0 * * * root /usr/bin/unattended-upgrade" >> /etc/crontab
# can also use @daily syntax or use /etc/cron.daily

echo "Starting supervisord ..."
exec /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf
Docker Pull Command
Owner
itech