167 lines
3.5 KiB
YAML
167 lines
3.5 KiB
YAML
#install cmd distrobuilder build-lxc alpine.yaml Alpine/
|
|
image:
|
|
distribution: "alpinelinux"
|
|
|
|
source:
|
|
downloader: alpinelinux-http
|
|
same_as: 3.12
|
|
url: http://192.168.2.83/alpine/
|
|
keys:
|
|
- 0482D84022F52DF1C4E7CD43293ACD0907D9495A
|
|
|
|
targets:
|
|
lxc:
|
|
create-message: |
|
|
You just created an {{ image.description }} container.
|
|
|
|
config:
|
|
- type: all
|
|
before: 5
|
|
content: |-
|
|
lxc.include = LXC_TEMPLATE_CONFIG/sabayon.common.conf
|
|
|
|
- type: user
|
|
before: 5
|
|
content: |-
|
|
lxc.include = LXC_TEMPLATE_CONFIG/sabayon.userns.conf
|
|
|
|
- type: all
|
|
after: 4
|
|
content: |-
|
|
lxc.include = LXC_TEMPLATE_CONFIG/common.conf
|
|
|
|
- type: user
|
|
after: 4
|
|
content: |-
|
|
lxc.include = LXC_TEMPLATE_CONFIG/userns.conf
|
|
|
|
- type: all
|
|
content: |-
|
|
lxc.arch = {{ image.architecture_kernel }}
|
|
|
|
files:
|
|
- path: /etc/hostname
|
|
generator: hostname
|
|
|
|
- path: /etc/hosts
|
|
generator: hosts
|
|
|
|
- path: /var/lib/dbus/machine-id
|
|
generator: remove
|
|
|
|
- path: /etc/netplan/10-lxc.yaml
|
|
generator: dump
|
|
content: |-
|
|
|
|
|
|
- path: /etc/network/interfaces
|
|
generator: dump
|
|
content: |-
|
|
auto eth0
|
|
iface eth0 inet dhcp
|
|
hostname $(hostname)
|
|
|
|
- path: /etc/inittab
|
|
generator: dump
|
|
content: |-
|
|
# /etc/inittab
|
|
::sysinit:/sbin/openrc sysinit
|
|
::sysinit:/sbin/openrc boot
|
|
::wait:/sbin/openrc default
|
|
|
|
# Set up a couple of getty's
|
|
::respawn:/sbin/getty 38400 console
|
|
#tty1::respawn:/sbin/getty 38400 tty1
|
|
#tty2::respawn:/sbin/getty 38400 tty2
|
|
#tty3::respawn:/sbin/getty 38400 tty3
|
|
#tty4::respawn:/sbin/getty 38400 tty4
|
|
|
|
# Stuff to do for the 3-finger salute
|
|
::ctrlaltdel:/sbin/reboot
|
|
|
|
# Stuff to do before rebooting
|
|
::shutdown:/sbin/openrc shutdown
|
|
|
|
- path: /etc/inittab
|
|
generator: template
|
|
name: inittab
|
|
content: |-
|
|
# /etc/inittab
|
|
::sysinit:/sbin/openrc sysinit
|
|
::sysinit:/sbin/openrc boot
|
|
::wait:/sbin/openrc default
|
|
|
|
# Set up a couple of getty's
|
|
::respawn:/sbin/getty 38400 console
|
|
|
|
# Stuff to do for the 3-finger salute
|
|
::ctrlaltdel:/sbin/reboot
|
|
|
|
# Stuff to do before rebooting
|
|
::shutdown:/sbin/openrc shutdown
|
|
|
|
packages:
|
|
manager: apk
|
|
update: true
|
|
cleanup: true
|
|
sets:
|
|
- packages:
|
|
- alpine-base
|
|
action: install
|
|
|
|
- packages:
|
|
- nano
|
|
- htop
|
|
- nload
|
|
- mariadb
|
|
- nginx
|
|
- samba
|
|
action: install
|
|
variants:
|
|
- extended
|
|
|
|
|
|
repositories:
|
|
- name: /etc/apk/repositories
|
|
url: |-
|
|
http://192.168.2.83/alpine/v{{ image.release }}/main
|
|
http://192.168.2.83/alpine/v{{ image.release }}/community
|
|
#http://192.168.200.83/alpine/v{{ image.release }}/main
|
|
#http://192.168.200.83/alpine/v{{ image.release }}/community
|
|
|
|
actions:
|
|
- trigger: post-unpack
|
|
action: |-
|
|
#!/bin/sh
|
|
sed -i '/dl-cdn.alpinelinux.org/d' /etc/apk/repositories
|
|
|
|
- trigger: post-unpack
|
|
action: |-
|
|
#!/bin/sh
|
|
sed -i 's/vedge/edge/g' /etc/apk/repositories
|
|
releases:
|
|
- edge
|
|
|
|
- trigger: post-packages
|
|
action: |-
|
|
#!/bin/sh
|
|
set -eux
|
|
|
|
# Rewrite configuration for LXC
|
|
sed -i 's/#rc_sys=""/rc_sys="lxc"/' /etc/rc.conf
|
|
|
|
# Enable services
|
|
for svc_name in bootmisc syslog; do
|
|
ln -s /etc/init.d/${svc_name} /etc/runlevels/boot/${svc_name}
|
|
done
|
|
|
|
for svc_name in networking crond; do
|
|
ln -s /etc/init.d/${svc_name} /etc/runlevels/default/${svc_name}
|
|
done
|
|
types:
|
|
- container
|
|
|
|
mappings:
|
|
architecture_map: alpinelinux
|
|
|