lxc-alpine.in revision 5afb809607919f245e635a3883d7d7febb0caffa
787N/A# Detect use under userns (unsupported) 789N/A if [
"$arg" =
"--mapped-uid" -o
"$arg" =
"--mapped-gid" ];
then 789N/A echo "This template can't be used for unprivileged containers." 1>&
2 789N/A echo "You may want to try the \"download\" template instead." 1>&
2 294N/A# Make sure the usual locations are in PATH 789N/Akey_sha256sums=
"9c102bcc376af1498d549b77bdbfa815ae86faa1d2d82f040e616b18ef2df2d4 alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub 789N/A2adcf7ce224f476330b5360ca5edb92fd0bf91c92d83292ed028d7c4e26333ab alpine-devel@lists.alpinelinux.org-4d07755e.rsa.pub 789N/Aebf31683b56410ecc4c00acd9f6e2839e237a3b62b5ae7ef686705c7ba0396a9 alpine-devel@lists.alpinelinux.org-5243ef4b.rsa.pub 789N/A1bb2a846c0ea4ca9d0e7862f970863857fc33c32f5506098c636a62a726a847b alpine-devel@lists.alpinelinux.org-524d27bb.rsa.pub 789N/A12f899e55a7691225603d6fb3324940fc51cd7f133e7ead788663c2b7eecb00c alpine-devel@lists.alpinelinux.org-5261cecb.rsa.pub" 294N/A echo -n "Determining the latest release... " 294N/A awk '$1 == "branch:" {print $2; exit 0}') 789N/A # parse APKINDEX to find the current versions 789N/A BEGIN { split(pkglist,pkg) } 789N/A $0 != "" { f[$1] = $2 } 789N/A $0 == "" { for (i in pkg) 789N/A print(f["P"] "-" f["V"] ".apk") }') 294N/A # clean up .apk meta files 294N/A # verify checksum of the key 789N/A # verify the static apk binary signature 294N/A::sysinit:/sbin/rc sysinit 294N/Aconsole:12345:respawn:/sbin/getty 38400 console 294N/Atty1:12345:respawn:/sbin/getty 38400 tty1 294N/Atty2:12345:respawn:/sbin/getty 38400 tty2 789N/Atty3:12345:respawn:/sbin/getty 38400 tty3 294N/Atty4:12345:respawn:/sbin/getty 38400 tty4 789N/A::ctrlaltdel:/sbin/reboot 294N/A::shutdown:/sbin/rc shutdown 789N/A # configure the network using the dhcp 789N/A cat <<EOF > $rootfs/etc/network/interfaces 294N/A echo "Setting up device nodes" 789N/A # if there is exactly one veth or macvlan network entry, make sure 789N/A # it has an associated mac address. 789N/Alxc.cap.drop = sys_module mac_admin mac_override sys_time sys_admin 789N/A# When using LXC with apparmor, uncomment the next line to run unconfined: 789N/A#lxc.aa_profile = unconfined 789N/Alxc.cgroup.devices.deny = a 789N/A# /dev/null, zero and full 789N/Alxc.cgroup.devices.allow = c 1:3 rwm 789N/Alxc.cgroup.devices.allow = c 1:5 rwm 789N/Alxc.cgroup.devices.allow = c 1:7 rwm 789N/Alxc.cgroup.devices.allow = c 5:1 rwm 789N/Alxc.cgroup.devices.allow = c 5:0 rwm 789N/Alxc.cgroup.devices.allow = c 4:0 rwm 789N/Alxc.cgroup.devices.allow = c 4:1 rwm 789N/Alxc.cgroup.devices.allow = c 1:9 rwm 789N/Alxc.cgroup.devices.allow = c 1:8 rwm 789N/Alxc.cgroup.devices.allow = c 136:* rwm 789N/Alxc.cgroup.devices.allow = c 5:2 rwm 789N/Alxc.cgroup.devices.allow = c 254:0 rm 789N/Alxc.mount.auto=cgroup:mixed proc:mixed sys:mixed 789N/Alxc.mount.entry=run run tmpfs nodev,noexec,nosuid,relatime,size=1m,mode=0755 0 0 789N/Alxc.mount.entry=shm dev/shm tmpfs nodev,nosuid,noexec,mode=1777,create=dir 0 0 789N/AUsage: $(basename $0) [-h|--help] [-r|--repository <url>] 789N/A [-R|--release <release>] [-a|--arch <arch>] 789N/A [--rootfs <rootfs>] -p|--path <path> -n|--name <name> 789N/A# template mknods, requires root 789N/Aif [ -z
"${path}" ];
then