Distrobuilder Alpine template

Yaml template used to create alpine n jenkins:

actions:
- trigger: post-packages
    # Enable services
    for svc_name in bootmisc syslog; do
        ln -s /etc/init.d/${svc_name} /etc/runlevels/boot/${svc_name}
    done
  types:
  - container

missing hostname.
This would work better:

for svc_name in bootmisc syslog hostname; do
    ln -s /etc/init.d/${svc_name} /etc/runlevels/boot/${svc_name}
done

also local apk cache which created during installation of packages remains there and causes a larger packed image size (rootfs 5M vs. 2M)
rm -rf /var/cache/apk/*
somewhere in post-packages actions would clean up the local cache.

Maybe something @monstermunchkin could comment on?

Also recommend logrotate.
Basic alpine hasnt it by default and I consider it as essential:
sets:
- packages:
- alpine-base
- logrotate
action: install

The hostname service is not needed, as /etc/hostname already contains the correct hostname. Everything else is included in the PR.

You are right about hostname. I ran that as service long go, now seems not necessary anymore.
BTW, logrotate needs to be activated as service too:

for svc_name in networking crond logrotate; do
    ln -s /etc/init.d/${svc_name} /etc/runlevels/default/${svc_name}
done

No, it doesn’t need to be activated. There’s no logrotate service in /etc/init.d. Instead, there is /etc/periodic/daily/logrotate which is run by crond.

1 Like

Indeed!
So I made some redundant efforts previously!