Create an Alpine 1.9 vserver template

From Alpine Linux
Revision as of 22:16, 3 October 2009 by Ncopa (talk | contribs) (Created page with '= How to create an Alpine 1.9 vserver template = A vserver template is a simple tar archive of a base install. Install base packages into a temporary root {{Cmd|sudo apk add --i...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

How to create an Alpine 1.9 vserver template

A vserver template is a simple tar archive of a base install.

Install base packages into a temporary root

sudo apk add --initdb --root /tmp/template --repositories-file /etc/apk/repositories --keys-dir /etc/apk/keys -U alpine-base

Vserver needs at least one process running when it boots up so we manually enable the syslog service in our template.

sudo chroot /tmp/template /sbin/rc-update add syslog boot

Create the archive as /tmp/template.tar.gz

cd /tmp/template && sudo tar -czf /tmp/template.tar.gz *

Finally remove the temp dir.

sudo rm -r /tmp/template