The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/distrobuilder/pull/239
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === This removes all examples but one, and points to the lxc-ci repository which has more up-to-date yaml files. Signed-off-by: Thomas Hipp <thomas.h...@canonical.com>
From 7e83080e1af638cac2a47583bf8080dbe76ac6a4 Mon Sep 17 00:00:00 2001 From: Thomas Hipp <thomas.h...@canonical.com> Date: Mon, 7 Oct 2019 16:16:56 +0200 Subject: [PATCH] doc: Update examples This removes all examples but one, and points to the lxc-ci repository which has more up-to-date yaml files. Signed-off-by: Thomas Hipp <thomas.h...@canonical.com> --- doc/{examples/ubuntu => example.yaml} | 34 ++++- doc/examples/alpine | 125 ------------------- doc/examples/alt | 90 -------------- doc/examples/apertis | 65 ---------- doc/examples/archlinux | 63 ---------- doc/examples/centos | 161 ------------------------ doc/examples/debian | 136 -------------------- doc/examples/debian-cloud-init | 143 --------------------- doc/examples/devuan | 137 -------------------- doc/examples/fedora | 59 --------- doc/examples/funtoo | 74 ----------- doc/examples/gentoo | 68 ---------- doc/examples/kali | 120 ------------------ doc/examples/kali-with-core-packages | 147 ---------------------- doc/examples/mint | 172 -------------------------- doc/examples/opensuse | 67 ---------- doc/examples/openwrt | 81 ------------ doc/examples/oraclelinux | 156 ----------------------- doc/examples/plamolinux | 123 ------------------ doc/examples/sabayon | 152 ----------------------- doc/examples/sabayon-docker | 153 ----------------------- doc/examples/ubuntu-core | 101 --------------- doc/examples/ubuntu-with-base-image | 160 ------------------------ doc/examples/voidlinux | 81 ------------ doc/examples/voidlinux-musl | 82 ------------ doc/index.md | 4 + 26 files changed, 36 insertions(+), 2718 deletions(-) rename doc/{examples/ubuntu => example.yaml} (88%) delete mode 100644 doc/examples/alpine delete mode 100644 doc/examples/alt delete mode 100644 doc/examples/apertis delete mode 100644 doc/examples/archlinux delete mode 100644 doc/examples/centos delete mode 100644 doc/examples/debian delete mode 100644 doc/examples/debian-cloud-init delete mode 100644 doc/examples/devuan delete mode 100644 doc/examples/fedora delete mode 100644 doc/examples/funtoo delete mode 100644 doc/examples/gentoo delete mode 100644 doc/examples/kali delete mode 100644 doc/examples/kali-with-core-packages delete mode 100644 doc/examples/mint delete mode 100644 doc/examples/opensuse delete mode 100644 doc/examples/openwrt delete mode 100644 doc/examples/oraclelinux delete mode 100644 doc/examples/plamolinux delete mode 100644 doc/examples/sabayon delete mode 100644 doc/examples/sabayon-docker delete mode 100644 doc/examples/ubuntu-core delete mode 100644 doc/examples/ubuntu-with-base-image delete mode 100644 doc/examples/voidlinux delete mode 100644 doc/examples/voidlinux-musl diff --git a/doc/examples/ubuntu b/doc/example.yaml similarity index 88% rename from doc/examples/ubuntu rename to doc/example.yaml index 830ea65..396f078 100644 --- a/doc/examples/ubuntu +++ b/doc/example.yaml @@ -1,6 +1,10 @@ image: - distribution: "ubuntu" - release: cosmic + name: ubuntu-disco-x86_64 + distribution: ubuntu + release: disco + description: |- + Ubuntu {{ image.release }} + architecture: x86_64 source: downloader: debootstrap @@ -112,6 +116,26 @@ files: releases: - trusty + - name: meta-data + generator: cloud-init + variants: + - cloud + + - name: network-config + generator: cloud-init + variants: + - cloud + + - name: user-data + generator: cloud-init + variants: + - cloud + + - name: vendor-data + generator: cloud-init + variants: + - cloud + packages: manager: apt update: true @@ -125,6 +149,12 @@ packages: - vim action: install + - packages: + - cloud-init + action: install + variants: + - cloud + actions: - trigger: post-update action: |- diff --git a/doc/examples/alpine b/doc/examples/alpine deleted file mode 100644 index d034c55..0000000 --- a/doc/examples/alpine +++ /dev/null @@ -1,125 +0,0 @@ -image: - distribution: "alpinelinux" - release: 3.8 - -source: - downloader: alpinelinux-http - same_as: 3.8 - url: http://dl-cdn.alpinelinux.org/alpine/ - keyserver: keyserver.ubuntu.com - keys: - - 0482D84022F52DF1C4E7CD43293ACD0907D9495A - -targets: - lxc: - create-message: | - You just created an {{ image.description }} container. - - config: - - type: all - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/alpine.common.conf - - - type: user - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/alpine.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_personality }} - -files: - - path: /etc/hostname - generator: hostname - - - path: /etc/hosts - generator: hosts - - - 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 - -actions: - - 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 - -mappings: - architecture_map: alpinelinux diff --git a/doc/examples/alt b/doc/examples/alt deleted file mode 100644 index 5f6c17a..0000000 --- a/doc/examples/alt +++ /dev/null @@ -1,90 +0,0 @@ -image: - distribution: ALT Linux - release: Sisyphus - description: ALT Linux {{ image.release }} - expiry: 30d - architecture: x86_64 - -source: - downloader: alt-http - url: http://ftp.altlinux.org/pub/distributions/ALTLinux/images - keyserver: keyserver.ubuntu.com - keys: - - 0x17F112840DE94827C9C109FD3E2B30EA57EF33CE - -targets: - lxc: - create-message: | - You just created an {{ image.distribution }} container (release={{ image.release }}, arch={{ image.architecture }}) - - config: - - type: all - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/alt.common.conf - - - type: user - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/alt.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: /etc/systemd/network/eth0.network - generator: dump - content: |- - [Match] - Name=eth0 - - [Network] - DHCP=ipv4 - -packages: - custom-manager: - install: - cmd: apt-get - flags: ["install", "-y"] - remove: - cmd: apt-get - flags: ["remove", "-y"] - update: - cmd: apt-get - flags: ["dist-upgrade", "-y"] - clean: - cmd: apt-get - flags: ["clean"] - refresh: - cmd: apt-get - flags: ["update"] - - update: true - cleanup: true - - sets: - - packages: - - vim-console - action: install - -environment: - variables: - - key: TMPDIR - set: false diff --git a/doc/examples/apertis b/doc/examples/apertis deleted file mode 100644 index 9c171d1..0000000 --- a/doc/examples/apertis +++ /dev/null @@ -1,65 +0,0 @@ -image: - distribution: Apertis - description: Apertis {{ image.architecture }} {{ image.variant }} {{ image.release }} {{ image.serial }} - release: v2019pre - variant: minimal - expiry: 30d - architecture: x86_64 - -source: - downloader: apertis-http - url: https://images.apertis.org - variant: release - -targets: - lxc: - create-message: | - You just created an {{ image.distribution }} container (release={{ image.release }}, arch={{ image.architecture }}) - - config: - - type: all - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/debian.common.conf - - - type: user - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/debian.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_personality }} - -files: - - path: /etc/hostname - generator: hostname - - - path: /etc/hosts - generator: hosts - - - path: /etc/machine-id - generator: remove - -packages: - manager: apt - update: false - cleanup: false - -environment: - variables: - - key: TMPDIR - set: false - -mappings: - architecture_map: debian diff --git a/doc/examples/archlinux b/doc/examples/archlinux deleted file mode 100644 index f165a7e..0000000 --- a/doc/examples/archlinux +++ /dev/null @@ -1,63 +0,0 @@ -image: - distribution: archlinux - release: 2018.03.01 - description: Arch Linux - expiry: 30d - architecture: x86_64 - -source: - downloader: archlinux-http - url: https://archive.archlinux.org/iso - keys: - - 4AA4767BBC9C4B1D18AE28B77F2D434B9741E8AC - -targets: - lxc: - create-message: | - You just created an Arch Linux container (release={{ image.release }}, arch={{ image.architecture }}) - - config: - - type: all - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/archlinux.common.conf - - - type: user - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/archlinux.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: - - name: hostname - path: /etc/hostname - generator: hostname - - - name: hosts - path: /etc/hosts - generator: hosts - -packages: - manager: pacman - - update: true - cleanup: true - - sets: - - packages: - - systemd-sysvcompat - - neovim - action: install diff --git a/doc/examples/centos b/doc/examples/centos deleted file mode 100644 index 1e7a5e4..0000000 --- a/doc/examples/centos +++ /dev/null @@ -1,161 +0,0 @@ -image: - distribution: centos - release: 7 - -source: - downloader: centos-http - url: http://centos.mirror.iweb.ca - keyserver: keyserver.ubuntu.com - keys: - - 6341AB2753D78A78A7C27BB124C6A8A7F4A80EB5 - - C1DAC52D1664E8A4386DBA430946FCA2C105B9DE - variant: minimal - -targets: - lxc: - create-message: | - You just created a {{ image.description }} container. - - config: - - type: all - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/centos.common.conf - - - type: user - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/centos.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: - - name: hostname - path: /etc/hostname - generator: hostname - - - name: hosts - path: /etc/hosts - generator: hosts - - - name: ifcfg-eth0 - path: /etc/sysconfig/network-scripts/ifcfg-eth0 - generator: dump - templated: true - content: |- - DEVICE=eth0 - BOOTPROTO=dhcp - ONBOOT=yes - HOSTNAME=LXC_NAME - NM_CONTROLLED=no - TYPE=Ethernet - MTU= - DHCP_HOSTNAME=`hostname` - - - name: network - path: /etc/sysconfig/network - generator: dump - templated: true - content: |- - NETWORKING=yes - HOSTNAME=LXC_NAME - - - name: ifcfg-eth0.lxd - path: /etc/sysconfig/network-scripts/ifcfg-eth0 - generator: template - content: |- - DEVICE=eth0 - BOOTPROTO=dhcp - ONBOOT=yes - HOSTNAME={{ container.name }} - NM_CONTROLLED=no - TYPE=Ethernet - MTU= - DHCP_HOSTNAME=`hostname` - - - name: network.lxd - path: /etc/sysconfig/network - generator: template - content: |- - NETWORKING=yes - HOSTNAME={{ container.name }} - - - name: lxc-sysinit - path: /etc/init/lxc-sysinit.conf - generator: dump - content: |- - start on startup - env container - - pre-start script - if [ "x$container" != "xlxc" -a "x$container" != "xlibvirt" ]; then - stop; - fi - - rm -f /var/lock/subsys/* - rm -f /var/run/*.pid - [ -e /etc/mtab ] || ln -s /proc/mounts /etc/mtab - mkdir -p /dev/shm - mount -t tmpfs -o nosuid,nodev tmpfs /dev/shm - - initctl start tty TTY=console - telinit 3 - exit 0 - end script - releases: - - 6 - - - name: sigpwr.conf - path: /etc/init/power-status-changed.conf - generator: dump - content: |- - start on power-status-changed - - exec /sbin/shutdown -h now "SIGPWR received" - releases: - - 6 - -packages: - manager: yum - update: true - cleanup: true - - sets: - - packages: - - cronie - - cronie-noanacron - - curl - - dhclient - - initscripts - - openssh-clients - - passwd - - policycoreutils - - rootfiles - - rsyslog - - vim-minimal - action: install - -actions: - - trigger: post-packages - action: |- - #!/bin/sh - set -eux - - # Disable SELinux - mkdir -p /selinux - echo 0 > /selinux/enforce - - # Disable loginuid in PAM stack - sed -i '/^session.*pam_loginuid.so/s/^session/# session/' /etc/pam.d/* diff --git a/doc/examples/debian b/doc/examples/debian deleted file mode 100644 index 41307d0..0000000 --- a/doc/examples/debian +++ /dev/null @@ -1,136 +0,0 @@ -image: - distribution: "debian" - release: testing - -source: - downloader: debootstrap - url: http://deb.debian.org/debian - keyserver: keyserver.ubuntu.com - keys: - - 0x126C0D24BD8A2942CC7DF8AC7638D0442B90D010 - - 0xA1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553 - variant: minbase - apt_sources: |- - deb http://deb.debian.org/debian {{ image.release }} main - {% if image.release != "sid" and image.release != "buster" and not (image.release == "wheezy" and image.architecture_mapped == "powerpc") and not (image.release == "wheezy" and image.architecture_mapped == "s390x") %}deb http://security.debian.org/debian-security {{ image.release }}/updates main{% endif %} - -targets: - lxc: - create-message: |- - You just created a {{ image.description }} container. - - To enable SSH, run: apt install openssh-server - No default root or user password are set by LXC. - - config: - - type: all - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/debian.common.conf - - - type: user - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/debian.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_personality }} - -files: - - path: /etc/hostname - generator: hostname - - - path: /etc/hosts - generator: hosts - - - path: /etc/resolvconf/resolv.conf.d/original - generator: remove - - - path: /etc/resolvconf/resolv.conf.d/tail - generator: remove - - - path: /etc/machine-id - generator: remove - - - path: /etc/network/interfaces - generator: dump - content: |- - # This file describes the network interfaces available on your system - # and how to activate them. For more information, see interfaces(5). - - # The loopback network interface - auto lo - iface lo inet loopback - - auto eth0 - iface eth0 inet dhcp - -packages: - manager: apt - update: true - cleanup: true - - sets: - - packages: - - dialog - - ifupdown - - isc-dhcp-client - - locales - - netbase - - net-tools - - openssh-client - - vim - - systemd - action: install - -actions: - - trigger: post-packages - action: |- - #!/bin/sh - set -eux - - # Make sure the locale is built and functional - echo en_US.UTF-8 UTF-8 >> /etc/locale.gen - locale-gen en_US.UTF-8 UTF-8 - update-locale LANG=en_US.UTF-8 - - # Cleanup underlying /run - mount -o bind / /mnt - rm -rf /mnt/run/* - umount /mnt - - # Cleanup temporary shadow paths - rm /etc/*- - - - trigger: post-packages - action: |- - #!/bin/sh - set -eux - apt-get install iproute sysvinit -y - releases: - - wheezy - - - trigger: post-packages - action: |- - #!/bin/sh - set -eux - apt-get install iproute2 init -y - releases: - - jessie - - stretch - - buster - - sid - -mappings: - architecture_map: debian diff --git a/doc/examples/debian-cloud-init b/doc/examples/debian-cloud-init deleted file mode 100644 index 15f3431..0000000 --- a/doc/examples/debian-cloud-init +++ /dev/null @@ -1,143 +0,0 @@ -image: - distribution: debian - release: testing - description: Debian testing - expiry: 30d - -source: - downloader: debootstrap - apt_sources: |- - deb http://deb.debian.org/debian {{ image.release }} main - {% if image.release != "sid" and image.release != "buster" and not (image.release == "wheezy" and image.architecture_mapped == "powerpc") and not (image.release == "wheezy" and image.architecture_mapped == "s390x") %}deb http://security.debian.org/debian-security {{ image.release }}/updates main{% endif %} - -targets: - lxc: - create-message: |- - You just created a {{ image.description }} container. - - To enable SSH, run: apt install openssh-server - No default root or user password are set by LXC. - - config: - - type: all - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/debian.common.conf - - - type: user - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/debian.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_personality }} - -files: - - path: /etc/hostname - generator: hostname - - - path: /etc/hosts - generator: hosts - - - path: /etc/resolvconf/resolv.conf.d/original - generator: remove - - - path: /etc/resolvconf/resolv.conf.d/tail - generator: remove - - - path: /etc/machine-id - generator: remove - - - path: /etc/network/interfaces - generator: dump - content: |- - # This file describes the network interfaces available on your system - # and how to activate them. For more information, see interfaces(5). - - # The loopback network interface - auto lo - iface lo inet loopback - - auto eth0 - iface eth0 inet dhcp - - - name: meta-data - generator: cloud-init - - - name: network-config - generator: cloud-init - - - name: user-data - generator: cloud-init - - - name: vendor-data - generator: cloud-init - -packages: - manager: apt - update: true - cleanup: true - - sets: - - packages: - - dialog - - ifupdown - - isc-dhcp-client - - locales - - netbase - - net-tools - - openssh-client - - vim - action: install - -actions: - - trigger: post-packages - action: |- - #!/bin/sh - set -eux - - # Make sure the locale is built and functional - echo en_US.UTF-8 UTF-8 >> /etc/locale.gen - locale-gen en_US.UTF-8 UTF-8 - update-locale LANG=en_US.UTF-8 - - # Cleanup underlying /run - mount -o bind / /mnt - rm -rf /mnt/run/* - umount /mnt - - # Cleanup temporary shadow paths - rm /etc/*- - - - trigger: post-packages - action: |- - #!/bin/sh - set -eux - apt-get install iproute sysvinit -y - releases: - - wheezy - - - trigger: post-packages - action: |- - #!/bin/sh - set -eux - apt-get install iproute2 init -y - releases: - - jessie - - stretch - - buster - - sid - -mappings: - architecture_map: debian diff --git a/doc/examples/devuan b/doc/examples/devuan deleted file mode 100644 index 7a6d901..0000000 --- a/doc/examples/devuan +++ /dev/null @@ -1,137 +0,0 @@ -image: - distribution: "devuan" - release: ascii - -source: - downloader: debootstrap - url: http://deb.devuan.org/merged - keyserver: keyserver.ubuntu.com - keys: - - 0x72E3CB773315DFA2E464743D94532124541922FB - - 0xE032601B7CA10BC3EA53FA81BB23C00C61FC752C - variant: minbase - apt_sources: |- - deb http://deb.devuan.org/merged {{ image.release }} main - deb http://deb.devuan.org/merged {{ image.release }}-security main - early_packages: - - devuan-keyring - -targets: - lxc: - create-message: |- - You just created a {{ image.description }} container. - - To enable SSH, run: apt install openssh-server - No default root or user password are set by LXC. - - config: - - type: all - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/debian.common.conf - - - type: user - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/debian.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_personality }} - -files: - - path: /etc/hostname - generator: hostname - - - path: /etc/hosts - generator: hosts - - - path: /etc/resolvconf/resolv.conf.d/original - generator: remove - - - path: /etc/resolvconf/resolv.conf.d/tail - generator: remove - - - path: /etc/machine-id - generator: remove - - - path: /etc/network/interfaces - generator: dump - content: |- - # This file describes the network interfaces available on your system - # and how to activate them. For more information, see interfaces(5). - - # The loopback network interface - auto lo - iface lo inet loopback - - auto eth0 - iface eth0 inet dhcp - - - path: /etc/apt/apt.conf.d/01lean - generator: dump - content: |- - APT::Install-Suggests "0"; - APT::Install-Recommends "0"; - APT::AutoRemove::SuggestsImportant "false"; - APT::AutoRemove::RecommendsImportant "false"; - -packages: - manager: apt - update: true - cleanup: true - - sets: - - packages: - - ca-certificates - - curl - - dialog - - dnsutils - - htop - - ifupdown - - iproute2 - - iputils-ping - - isc-dhcp-client - - less - - locales - - nano - - net-tools - - netbase - - openssh-client - - rsync - - sysv-rc-conf - - vim-tiny - - wget - action: install - -actions: - - trigger: post-packages - action: |- - #!/bin/sh - set -eux - - # Make sure the locale is built and functional - echo en_US.UTF-8 UTF-8 >> /etc/locale.gen - locale-gen en_US.UTF-8 UTF-8 - update-locale LANG=en_US.UTF-8 - - # Cleanup underlying /run - mount -o bind / /mnt - rm -rf /mnt/run/* - umount /mnt - - # Cleanup temporary shadow paths - rm /etc/*- - -mappings: - architecture_map: debian diff --git a/doc/examples/fedora b/doc/examples/fedora deleted file mode 100644 index ea2e446..0000000 --- a/doc/examples/fedora +++ /dev/null @@ -1,59 +0,0 @@ -image: - distribution: fedora - release: 28 - description: Fedora {{ image.release }} - expiry: 30d - architecture: x86_64 - -source: - downloader: fedora-http - url: https://kojipkgs.fedoraproject.org - -targets: - lxc: - create-message: | - You just created a Fedora container (release={{ image.release }}, arch={{ image.architecture }}) - - config: - - type: all - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/fedora.common.conf - - - type: user - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/fedora.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 - -packages: - manager: dnf - - update: true - cleanup: true - - sets: - - packages: - - systemd - - neovim - action: install diff --git a/doc/examples/funtoo b/doc/examples/funtoo deleted file mode 100644 index 1dd81ab..0000000 --- a/doc/examples/funtoo +++ /dev/null @@ -1,74 +0,0 @@ -image: - distribution: funtoo - description: Funtoo - expiry: 30d - release: 1.3 - architecture: x86_64 - -source: - downloader: funtoo-http - url: http://build.funtoo.org - keys: - - 30737D12308C9D0C882FC34B57CB0A121BAECB2E - -targets: - lxc: - create-message: | - You just created a Funtoo container (arch={{ image.architecture }}) - - config: - - type: all - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/gentoo.common.conf - - - type: user - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/gentoo.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 - -packages: - manager: egoportage - - update: true - cleanup: true - -actions: - - trigger: post-packages - action: |- - #! /bin/sh - set -eux - - rm -rf /boot/* - rm -rf /usr/src/* - rm -rf /var/git/meta-repo - rm -rf /var/cache/portage - - cd /etc/init.d - ln -s netif.tmpl net.eth0 - rc-update add net.eth0 default - echo template=dhcpcd > /etc/conf.d/net.eth0 - -mappings: - architecture_map: funtoo diff --git a/doc/examples/gentoo b/doc/examples/gentoo deleted file mode 100644 index 9ec6a0b..0000000 --- a/doc/examples/gentoo +++ /dev/null @@ -1,68 +0,0 @@ -image: - distribution: gentoo - description: Gentoo - expiry: 30d - architecture: amd64 - -source: - downloader: gentoo-http - url: http://distfiles.gentoo.org - keys: - - 13EBBDBEDE7A12775DFDB1BABB572E0E2D182910 - -targets: - lxc: - create-message: | - You just created a Gentoo container (arch={{ image.architecture }}) - - config: - - type: all - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/gentoo.common.conf - - - type: user - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/gentoo.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 - -packages: - manager: portage - - update: true - cleanup: true - - sets: - - packages: - - neovim - action: install - -actions: - - trigger: post-packages - action: |- - #!/bin/sh - rm -rf /usr/portage/ - -mappings: - architecture_map: gentoo diff --git a/doc/examples/kali b/doc/examples/kali deleted file mode 100644 index f5f6056..0000000 --- a/doc/examples/kali +++ /dev/null @@ -1,120 +0,0 @@ -image: - distribution: "kali" - release: kali-rolling - -source: - downloader: debootstrap - url: http://http.kali.org/kali - keyserver: keys.gnupg.net - keys: - - 44C6513A8E4FB3D30875F758ED444FF07D8D0BF6 - variant: minbase - apt_sources: |- - deb http://http.kali.org/kali {{ image.release }} main non-free contrib - early_packages: - - kali-archive-keyring - -targets: - lxc: - create-message: |- - You just created a {{ image.description }} container. - - To enable SSH, run: apt install openssh-server - No default root or user password are set by LXC. - - config: - - type: all - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/debian.common.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_personality }} - -files: - - path: /etc/hostname - generator: hostname - - - path: /etc/hosts - generator: hosts - - - path: /etc/resolvconf/resolv.conf.d/original - generator: remove - - - path: /etc/resolvconf/resolv.conf.d/tail - generator: remove - - - path: /etc/machine-id - generator: remove - - - path: /etc/network/interfaces - generator: dump - content: |- - # This file describes the network interfaces available on your system - # and how to activate them. For more information, see interfaces(5). - - # The loopback network interface - auto lo - iface lo inet loopback - - auto eth0 - iface eth0 inet dhcp - -packages: - manager: apt - update: true - cleanup: true - - sets: - - packages: - - dialog - - ifupdown - - isc-dhcp-client - - locales - - netbase - - net-tools - - openssh-client - - vim - - systemd - action: install - -actions: - - trigger: post-packages - action: |- - #!/bin/sh - set -eux - - # Make sure the locale is built and functional - echo en_US.UTF-8 UTF-8 >> /etc/locale.gen - locale-gen en_US.UTF-8 UTF-8 - update-locale LANG=en_US.UTF-8 - - # Cleanup underlying /run - mount -o bind / /mnt - rm -rf /mnt/run/* - umount /mnt - - # Cleanup temporary shadow paths - rm /etc/*- - - - trigger: post-packages - action: |- - #!/bin/sh - set -eux - apt-get install iproute2 init -y - releases: - - kali-rolling - -mappings: - architecture_map: debian diff --git a/doc/examples/kali-with-core-packages b/doc/examples/kali-with-core-packages deleted file mode 100644 index bdefab2..0000000 --- a/doc/examples/kali-with-core-packages +++ /dev/null @@ -1,147 +0,0 @@ -image: - distribution: "kali" - release: kali-rolling - -source: - downloader: debootstrap - url: http://http.kali.org/kali - keyserver: keys.gnupg.net - keys: - - 44C6513A8E4FB3D30875F758ED444FF07D8D0BF6 - variant: minbase - apt_sources: |- - deb http://http.kali.org/kali {{ image.release }} main non-free contrib - early_packages: - - kali-archive-keyring - -targets: - lxc: - create-message: |- - You just created a {{ image.description }} container. - - To enable SSH, run: apt install openssh-server - No default root or user password are set by LXC. - - config: - - type: all - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/debian.common.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_personality }} - -files: - - path: /etc/hostname - generator: hostname - - - path: /etc/hosts - generator: hosts - - - path: /etc/resolvconf/resolv.conf.d/original - generator: remove - - - path: /etc/resolvconf/resolv.conf.d/tail - generator: remove - - - path: /etc/machine-id - generator: remove - - - path: /etc/network/interfaces - generator: dump - content: |- - # This file describes the network interfaces available on your system - # and how to activate them. For more information, see interfaces(5). - - # The loopback network interface - auto lo - iface lo inet loopback - - auto eth0 - iface eth0 inet dhcp - -packages: - manager: apt - update: true - cleanup: true - - sets: - - packages: - - dialog - - ifupdown - - isc-dhcp-client - - locales - - netbase - - net-tools - - openssh-client - - vim - - systemd - - iw - - kali-defaults - - mlocate - - netcat-traditional - - net-tools - - psmisc - - screen - - tmux - - wget - - zerofree - - exploitdb - - hydra - - john - - medusa - - metasploit-framework - - mfoc - - ncrack - - nmap - - passing-the-hash - - proxychains - - recon-ng - - sqlmap - - tcpdump - - theharvester - - tor - - tshark - - whois - action: install - -actions: - - trigger: post-packages - action: |- - #!/bin/sh - set -eux - - # Make sure the locale is built and functional - echo en_US.UTF-8 UTF-8 >> /etc/locale.gen - locale-gen en_US.UTF-8 UTF-8 - update-locale LANG=en_US.UTF-8 - - # Cleanup underlying /run - mount -o bind / /mnt - rm -rf /mnt/run/* - umount /mnt - - # Cleanup temporary shadow paths - rm /etc/*- - - - trigger: post-packages - action: |- - #!/bin/sh - set -eux - apt-get install iproute2 init -y - releases: - - kali-rolling - -mappings: - architecture_map: debian diff --git a/doc/examples/mint b/doc/examples/mint deleted file mode 100644 index 9006b33..0000000 --- a/doc/examples/mint +++ /dev/null @@ -1,172 +0,0 @@ -image: - distribution: Mint - release: sylvia - description: Mint {{ image.release }} - architecture: amd64 - -source: - downloader: debootstrap - url: http://us.archive.ubuntu.com/ubuntu - keys: - - 0x790BC7277767219C42C86F933B4FE6ACC0B21F32 - keyserver: keyserver.ubuntu.com - suite: xenial - ignore_release: true - - apt_sources: |- - deb http://packages.linuxmint.com {{ image.release }} main upstream import backport - deb {{ source.url }} {{ source.suite }} main restricted universe multiverse - deb {{ source.url }} {{ source.suite }}-updates main restricted universe multiverse - deb http://security.ubuntu.com/ubuntu {{ source.suite }}-security main restricted universe multiverse - -targets: - lxc: - create-message: | - You just created an {{ image.description }} container. - - To enable SSH, run: apt install openssh-server - No default root or user password are set by LXC. - - config: - - type: all - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.common.conf - - - type: user - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.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: /etc/init/lxc-tty.conf - generator: upstart-tty - releases: - - precise - - trusty - -files: - - path: /etc/hostname - generator: hostname - - - path: /etc/hosts - generator: hosts - - - path: /etc/resolvconf/resolv.conf.d/original - generator: remove - - - path: /etc/resolvconf/resolv.conf.d/tail - generator: remove - - - path: /etc/machine-id - generator: remove - - - path: /etc/netplan/10-lxc.yaml - generator: dump - content: |- - network: - ethernets: - eth0: {dhcp4: true} - version: 2 - releases: - - artful - - bionic - - - path: /etc/network/interfaces - generator: dump - content: |- - # This file describes the network interfaces available on your system - # and how to activate them. For more information, see interfaces(5). - - # The loopback network interface - auto lo - iface lo inet loopback - - auto eth0 - iface eth0 inet dhcp - releases: - - trusty - - xenial - - - path: /etc/init/lxc-tty.conf - generator: upstart-tty - releases: - - precise - - trusty - -packages: - manager: apt - - # Do not update here. Updates will take place in the post-unpack action. - update: false - cleanup: true - - sets: - - packages: - - apt-transport-https - - language-pack-en - - openssh-client - - vim - action: install - -actions: - - trigger: post-unpack - action: |- - #!/bin/sh - set -eux - - apt-key adv --keyserver keyserver.ubuntu.com --recv 0xA6616109451BBBF2 - apt-get update - apt-get install -y --allow-unauthenticated linuxmint-keyring - apt-get dist-upgrade -y --allow-unauthenticated || true - apt-get -f install -y - apt-get dist-upgrade -y --allow-unauthenticated - - - trigger: post-update - action: |- - #!/bin/sh - set -eux - - # Create the ubuntu user account - getent group sudo >/dev/null 2>&1 || groupadd --system sudo - useradd --create-home -s /bin/bash -G sudo -U ubuntu - - - trigger: post-packages - action: |- - #!/bin/sh - set -eux - - # Make sure the locale is built and functional - locale-gen en_US.UTF-8 - update-locale LANG=en_US.UTF-8 - - # Cleanup underlying /run - mount -o bind / /mnt - rm -rf /mnt/run/* - umount /mnt - - # Cleanup temporary shadow paths - rm /etc/*- - -mappings: - architecture_map: debian diff --git a/doc/examples/opensuse b/doc/examples/opensuse deleted file mode 100644 index c19b837..0000000 --- a/doc/examples/opensuse +++ /dev/null @@ -1,67 +0,0 @@ -image: - distribution: openSUSE - release: 15.0 - description: openSUSE Leap {{ image.release }} - expiry: 30d - architecture: x86_64 - -source: - downloader: opensuse-http - url: https://download.opensuse.org - keyserver: keyserver.ubuntu.com - keys: - - 0xA193FBB572174FC2 - -targets: - lxc: - create-message: | - You just created an openSUSE Leap container (release={{ image.release }}, arch={{ image.architecture }}) - - config: - - type: all - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/opensuse.common.conf - - - type: user - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/opensuse.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 - -packages: - manager: zypper - - update: true - cleanup: true - - sets: - - packages: - - systemd - - neovim - action: install - -environment: - variables: - - key: HOME - value: /root \ No newline at end of file diff --git a/doc/examples/openwrt b/doc/examples/openwrt deleted file mode 100644 index a2e9d44..0000000 --- a/doc/examples/openwrt +++ /dev/null @@ -1,81 +0,0 @@ -image: - distribution: OpenWrt - release: snapshot - description: OpenWrt {{ image.release }} - expiry: 1d # snapshots are only valid for a day - architecture: x86_64 - -source: - downloader: openwrt-http - url: https://downloads.openwrt.org - keyserver: keyserver.ubuntu.com - keys: - - 0x6768C55E79B032D77A28DA5F0F20257417E1CE16 - - 0x54CC74307A2C6DC9CE618269CD84BCED626471F1 - - 0x6D9278A33A9AB3146262DCECF93525A88B699029 - -targets: - lxc: - create-message: | - You just created an {{ image.distribution }} container (release={{ image.release }}, arch={{ image.architecture }}) - - config: - - type: all - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/openwrt.common.conf - - - type: user - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/openwrt.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: /etc/config/network - generator: dump - content: |- - config interface 'loopback' - option ifname 'lo' - option proto 'static' - option ipaddr '127.0.0.1' - option netmask '255.0.0.0' - - config interface 'wan' - option ifname 'eth0' - option proto 'dhcp' - - config interface 'wan6' - option ifname 'eth0' - option proto 'dhcp6' - -actions: - - trigger: post-unpack - action: | - #!/bin/sh - mkdir -p /var/lock - echo "console::askfirst:/usr/libexec/login.sh" >> /etc/inittab - -packages: - manager: opkg - update: false - cleanup: true diff --git a/doc/examples/oraclelinux b/doc/examples/oraclelinux deleted file mode 100644 index f7bbff6..0000000 --- a/doc/examples/oraclelinux +++ /dev/null @@ -1,156 +0,0 @@ -image: - distribution: oraclelinux - release: 7 - -source: - downloader: oraclelinux-http - url: https://mirror.aarnet.edu.au/pub/oraclelinux - -targets: - lxc: - create-message: | - You just created a {{ image.description }} container. - - config: - - type: all - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/oraclelinux.common.conf - - - type: user - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/oraclelinux.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: - - name: hostname - path: /etc/hostname - generator: hostname - - - name: hosts - path: /etc/hosts - generator: hosts - - - name: ifcfg-eth0 - path: /etc/sysconfig/network-scripts/ifcfg-eth0 - generator: dump - templated: true - content: |- - DEVICE=eth0 - BOOTPROTO=dhcp - ONBOOT=yes - HOSTNAME=LXC_NAME - NM_CONTROLLED=no - TYPE=Ethernet - MTU= - DHCP_HOSTNAME=`hostname` - - - name: network - path: /etc/sysconfig/network - generator: dump - templated: true - content: |- - NETWORKING=yes - HOSTNAME=LXC_NAME - - - name: ifcfg-eth0.lxd - path: /etc/sysconfig/network-scripts/ifcfg-eth0 - generator: template - content: |- - DEVICE=eth0 - BOOTPROTO=dhcp - ONBOOT=yes - HOSTNAME={{ container.name }} - NM_CONTROLLED=no - TYPE=Ethernet - MTU= - DHCP_HOSTNAME=`hostname` - - - name: network.lxd - path: /etc/sysconfig/network - generator: template - content: |- - NETWORKING=yes - HOSTNAME={{ container.name }} - - - name: lxc-sysinit - path: /etc/init/lxc-sysinit.conf - generator: dump - content: |- - start on startup - env container - - pre-start script - if [ "x$container" != "xlxc" -a "x$container" != "xlibvirt" ]; then - stop; - fi - - rm -f /var/lock/subsys/* - rm -f /var/run/*.pid - [ -e /etc/mtab ] || ln -s /proc/mounts /etc/mtab - mkdir -p /dev/shm - mount -t tmpfs -o nosuid,nodev tmpfs /dev/shm - - initctl start tty TTY=console - telinit 3 - exit 0 - end script - releases: - - 6 - - - name: sigpwr.conf - path: /etc/init/power-status-changed.conf - generator: dump - content: |- - start on power-status-changed - - exec /sbin/shutdown -h now "SIGPWR received" - releases: - - 6 - -packages: - manager: yum - update: true - cleanup: true - - sets: - - packages: - - cronie - - cronie-noanacron - - curl - - dhclient - - initscripts - - openssh-clients - - passwd - - policycoreutils - - rootfiles - - rsyslog - - vim-minimal - action: install - -actions: - - trigger: post-packages - action: |- - #!/bin/sh - set -eux - - # Disable SELinux - mkdir -p /selinux - echo 0 > /selinux/enforce - - # Disable loginuid in PAM stack - sed -i '/^session.*pam_loginuid.so/s/^session/# session/' /etc/pam.d/* diff --git a/doc/examples/plamolinux b/doc/examples/plamolinux deleted file mode 100644 index d5b70b4..0000000 --- a/doc/examples/plamolinux +++ /dev/null @@ -1,123 +0,0 @@ -image: - distribution: plamolinux - release: 7 - description: Plamo Linux - expiry: 30d - architecture: x86_64 - -source: - downloader: plamolinux-http - url: https://repository.plamolinux.org/pub/linux/Plamo - -targets: - lxc: - create-message: | - You just created a Plamo Linux container (release={{ image.release }}, arch={{ image.architecture }}) - - config: - - type: all - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/plamolinux.common.conf - - - type: user - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/plamolinux.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: - - name: hostname - path: /etc/hostname - generator: hostname - - - name: hosts - path: /etc/hosts - generator: hosts - -packages: - custom-manager: - install: - cmd: installpkg - remove: - cmd: removepkg - update: - cmd: updatepkg - clean: - cmd: true - refresh: - cmd: true - -actions: - - trigger: post-unpack - action: | - #!/bin/sh - # fstab - cat <<- "EOF" >> /etc/fstab - proc /proc proc defaults 0 0 - tmpfs /run tmpfs defaults 0 0 - sysfs /sys sysfs defaults 0 0 - tmpfs /tmp tmpfs defaults 0 0 - devpts /dev/pts devpts gid=5,mode=620 0 0 - usbfs /proc/bus/usb usbfs noauto 0 0 - EOF - - # inittab - sed -i -e '/^1:2345/i c:1235:respawn:/sbin/agetty console 38400'\ - -e '/^ca:/a pf::powerfail:/sbin/shutdown -h +0 "THE POWER IS FAILING"' \ - -e '/^4:2345/d' \ - -e '/^5:2345/d' \ - -e '/^6:2345/d' /etc/inittab - - # tweak init script on startup - remove_init_S="S05modules S10eudev S20swap S30checkfs S35setclock S50eudev_retry S70console" - for f in $remove_init_S - do - rm -f /etc/rc.d/rcS.d/"$f" - done - - # remove init script in runlevel3 - remove_init="rc3.d/S30sshd - rc6.d/K30sshd rc6.d/K35setclock rc6.d/S65swap rc6.d/S70mountfs - rc0.d/K30sshd rc0.d/K35setclock rc0.d/S65swap rc0.d/S70mountfs" - for f in $remove_init - do - rm -f /etc/rc.d/"$f" - done - - # Tweak rc script - sed -i -e '/wait_for_user/d' \ - -e '/Press Enter to/d' \ - /etc/rc.d/init.d/rc - - # network - cat <<- "EOF" > /etc/sysconfig/ifconfig.eth0 - ONBOOT="yes" - IFACE="eth0" - SERVICE="dhclient" - EOF - - # initpkg - noexec="shadow netconfig7 eudev openssh" - for f in $noexec - do - rm -f /var/log/initpkg/"$f" - done - - for f in /var/log/initpkg/* - do - sh $f - done diff --git a/doc/examples/sabayon b/doc/examples/sabayon deleted file mode 100644 index 372530a..0000000 --- a/doc/examples/sabayon +++ /dev/null @@ -1,152 +0,0 @@ -image: - distribution: sabayon - decription: Sabayon - expiry: 30d - architecture: amd64 - -source: - downloader: sabayon-http - url: http://dl.sabayon.org/sbi/sabayon%3Aiso/iso - -environment: - clear_defaults: true - variables: - - key: "SHELL" - value: "/bin/bash" - - key: "ACCEPT_LICENSE" - value: "*" - - key: "ETP_NONINTERACTIVE" - value: "1" - -targets: - lxc: - create-message: | - You just created a Sabayon container (arch={{ image.architecture }}) - - 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 - -packages: - manager: equo - -# repositories: -# - name: "community" -# type: "enman" - # Enable main repository -# - name: "sabayonlinux.org" -# type: "equo" - - update: true - cleanup: true - - sets: - - packages: - - sabayon-live - action: install - -actions: - # Spinbase image doesn't include enman tool - # for external repositories. This is not needed - # if external repository aren't used or it's used equ - # as repo type. - #- trigger: post-unpack - # action: |- - # #!/bin/sh - # equo up && equo i enman - - - trigger: post-packages - action: |- - #!/bin/sh - echo -5 | equo conf update - - # Disable systemd-remount-fs.service because - # on unprivileged container systemd can't - # remount filesystem. - - trigger: post-packages - action: |- - #!/bin/sh - cd /etc/systemd/system - ln -s /dev/null systemd-remount-fs.service - - # Disable mount of hugepages - - trigger: post-packages - action: |- - #!/bin/bash - cd /etc/systemd/system - ln -s /dev/null dev-hugepages.mount - - # Disable systemd-journald-audit service - - trigger: post-packages - action: |- - #!/bin/bash - cd /etc/systemd/system - ln -s /dev/null systemd-journald-audit.socket - - # Disable sabayon-anti-fork-bomb limits - # (already apply to host) - - trigger: post-packages - action: |- - #!/bin/bash - sed -i -e 's/^*/#*/g' /etc/security/limits.d/00-sabayon-anti-fork-bomb.conf - sed -i -e 's/^root/#root/g' /etc/security/limits.d/00-sabayon-anti-fork-bomb.conf - - # Configure DHCP for interface eth0 by default. - # Avoid to use DHCP for any interface to avoid reset of docker - # interfaces or others custom interfaces. - - trigger: post-packages - action: |- - #!/bin/bash - cat > /etc/systemd/network/default_dhcp.network << "EOF" - [Network] - DHCP=ipv4 - - [Match] - Name=eth0 - - [DHCP] - UseDomains=true - EOF - - # Enable systemd-networkd service by default. - - trigger: post-packages - action: |- - #!/bin/bash - systemctl enable systemd-networkd - - # Clean journal directory (to avoid permission errors) - - trigger: post-packages - action: |- - rm -rf /var/log/journal/ - -mappings: - architecture_map: debian - diff --git a/doc/examples/sabayon-docker b/doc/examples/sabayon-docker deleted file mode 100644 index 23cfda1..0000000 --- a/doc/examples/sabayon-docker +++ /dev/null @@ -1,153 +0,0 @@ -image: - distribution: sabayon - decription: Sabayon Builder - expiry: 30d - variant: builder - architecture: amd64 - -source: - downloader: docker-http - url: sabayon/builder-amd64 - -environment: - clear_defaults: true - variables: - - key: "SHELL" - value: "/bin/bash" - - key: "ACCEPT_LICENSE" - value: "*" - - key: "ETP_NONINTERACTIVE" - value: "1" - -targets: - lxc: - create-message: | - You just created a Sabayon container (arch={{ image.architecture }}) - - 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 - -packages: - manager: equo - -# repositories: -# - name: "community" -# type: "enman" - # Enable main repository -# - name: "sabayonlinux.org" -# type: "equo" - - update: true - cleanup: true - - sets: - - packages: - - sabayon-live - action: install - -actions: - # Spinbase image doesn't include enman tool - # for external repositories. This is not needed - # if external repository aren't used or it's used equ - # as repo type. - #- trigger: post-unpack - # action: |- - # #!/bin/sh - # equo up && equo i enman - - - trigger: post-packages - action: |- - #!/bin/sh - echo -5 | equo conf update - - # Disable systemd-remount-fs.service because - # on unprivileged container systemd can't - # remount filesystem. - - trigger: post-packages - action: |- - #!/bin/sh - cd /etc/systemd/system - ln -s /dev/null systemd-remount-fs.service - - # Disable mount of hugepages - - trigger: post-packages - action: |- - #!/bin/bash - cd /etc/systemd/system - ln -s /dev/null dev-hugepages.mount - - # Disable systemd-journald-audit service - - trigger: post-packages - action: |- - #!/bin/bash - cd /etc/systemd/system - ln -s /dev/null systemd-journald-audit.socket - - # Disable sabayon-anti-fork-bomb limits - # (already apply to host) - - trigger: post-packages - action: |- - #!/bin/bash - sed -i -e 's/^*/#*/g' /etc/security/limits.d/00-sabayon-anti-fork-bomb.conf - sed -i -e 's/^root/#root/g' /etc/security/limits.d/00-sabayon-anti-fork-bomb.conf - - # Configure DHCP for interface eth0 by default. - # Avoid to use DHCP for any interface to avoid reset of docker - # interfaces or others custom interfaces. - - trigger: post-packages - action: |- - #!/bin/bash - cat > /etc/systemd/network/default_dhcp.network << "EOF" - [Network] - DHCP=ipv4 - - [Match] - Name=eth0 - - [DHCP] - UseDomains=true - EOF - - # Enable systemd-networkd service by default. - - trigger: post-packages - action: |- - #!/bin/bash - systemctl enable systemd-networkd - - # Clean journal directory (to avoid permission errors) - - trigger: post-packages - action: |- - rm -rf /var/log/journal/ - -mappings: - architecture_map: debian - diff --git a/doc/examples/ubuntu-core b/doc/examples/ubuntu-core deleted file mode 100644 index 3400877..0000000 --- a/doc/examples/ubuntu-core +++ /dev/null @@ -1,101 +0,0 @@ -image: - distribution: ubuntu - release: 16 - variant: core - description: Ubuntu Core {{ image.release }} - expiry: 30d - architecture: amd64 - -source: - downloader: ubuntu-http - variant: core - url: http://cdimage.ubuntu.com/ubuntu-core - keys: - - 0x46181433FBB75451 - - 0xD94AA3F0EFE21092 - -targets: - lxc: - create-message: |- - You just created an {{ image.description }} container. - - To enable SSH, run: apt install openssh-server - No default root or user password are set by LXC. - - config: - - type: all - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.common.conf - - - type: user - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.userns.conf - - - type: all - after: 4 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/common.conf - - # For Ubuntu 14.04 - lxc.mount.entry = /sys/kernel/debug sys/kernel/debug none bind,optional 0 0 - lxc.mount.entry = /sys/kernel/security sys/kernel/security none bind,optional 0 0 - lxc.mount.entry = /sys/fs/pstore sys/fs/pstore none bind,optional 0 0 - lxc.mount.entry = mqueue dev/mqueue mqueue rw,relatime,create=dir,optional 0 0 - - - type: user - after: 4 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/userns.conf - - # For Ubuntu 14.04 - lxc.mount.entry = /sys/firmware/efi/efivars sys/firmware/efi/efivars none bind,optional 0 0 - lxc.mount.entry = /proc/sys/fs/binfmt_misc proc/sys/fs/binfmt_misc none bind,optional 0 0 - - - type: all - content: |- - lxc.arch = {{ image.architecture_personality }} - -packages: - custom-manager: - install: - cmd: true - remove: - cmd: true - update: - cmd: true - clean: - cmd: true - refresh: - cmd: true - -files: - - name: cloud-init-meta - path: /lxd/meta-data - generator: template - - name: cloud-init-network - path: /lxd/network-config - generator: template - - name: cloud-init-user - path: /lxd/user-data - generator: template - template: - properties: - default: | - #cloud-config - {} - - name: cloud-init-vendor - path: /lxd/vendor-data - generator: template - template: - properties: - default: | - #cloud-config - {} - - name: hostname - path: /lxd/hostname - generator: template - -mappings: - architecture_map: debian diff --git a/doc/examples/ubuntu-with-base-image b/doc/examples/ubuntu-with-base-image deleted file mode 100644 index 118585a..0000000 --- a/doc/examples/ubuntu-with-base-image +++ /dev/null @@ -1,160 +0,0 @@ -image: - distribution: ubuntu - release: cosmic - variant: default - description: Ubuntu {{ image.release }} - expiry: 30d - architecture: amd64 - -source: - downloader: ubuntu-http - url: http://cdimage.ubuntu.com/ubuntu-base - keys: - - 0x46181433FBB75451 - - 0xD94AA3F0EFE21092 - - apt_sources: |- - {% if image.architecture_mapped == "amd64" or image.architecture_mapped == "i386" %}deb http://archive.ubuntu.com/ubuntu {{ image.release }} main restricted universe multiverse - deb http://archive.ubuntu.com/ubuntu {{ image.release }}-updates main restricted universe multiverse - deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse - {% else %}deb http://ports.ubuntu.com/ubuntu-ports {{ image.release }} main restricted universe multiverse - deb http://ports.ubuntu.com/ubuntu-ports {{ image.release }}-updates main restricted universe multiverse - deb http://ports.ubuntu.com/ubuntu-ports {{ image.release }}-security main restricted universe multiverse - {% endif %} - -targets: - lxc: - create-message: |- - You just created an {{ image.description }} container. - - To enable SSH, run: apt install openssh-server - No default root or user password are set by LXC. - - config: - - type: all - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.common.conf - - - type: user - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.userns.conf - - - type: all - after: 4 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/common.conf - - # For Ubuntu 14.04 - lxc.mount.entry = /sys/kernel/debug sys/kernel/debug none bind,optional 0 0 - lxc.mount.entry = /sys/kernel/security sys/kernel/security none bind,optional 0 0 - lxc.mount.entry = /sys/fs/pstore sys/fs/pstore none bind,optional 0 0 - lxc.mount.entry = mqueue dev/mqueue mqueue rw,relatime,create=dir,optional 0 0 - - - type: user - after: 4 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/userns.conf - - # For Ubuntu 14.04 - lxc.mount.entry = /sys/firmware/efi/efivars sys/firmware/efi/efivars none bind,optional 0 0 - lxc.mount.entry = /proc/sys/fs/binfmt_misc proc/sys/fs/binfmt_misc none bind,optional 0 0 - - - type: all - content: |- - lxc.arch = {{ image.architecture_personality }} - -files: - - path: /etc/hostname - generator: hostname - - - path: /etc/hosts - generator: hosts - - - path: /etc/resolvconf/resolv.conf.d/original - generator: remove - - - path: /etc/resolvconf/resolv.conf.d/tail - generator: remove - - - path: /etc/machine-id - generator: remove - - - path: /etc/netplan/10-lxc.yaml - generator: dump - content: |- - network: - version: 2 - ethernets: - eth0: {dhcp4: true} - releases: - - artful - - bionic - - cosmic - - disco - - - path: /etc/network/interfaces - generator: dump - content: |- - # This file describes the network interfaces available on your system - # and how to activate them. For more information, see interfaces(5). - - # The loopback network interface - auto lo - iface lo inet loopback - - auto eth0 - iface eth0 inet dhcp - releases: - - trusty - - xenial - - - path: /etc/init/lxc-tty.conf - generator: upstart-tty - releases: - - trusty - -packages: - manager: apt - update: true - cleanup: true - - sets: - - packages: - - apt-transport-https - - language-pack-en - - openssh-client - - vim - - systemd - action: install - -actions: - - trigger: post-update - action: |- - #!/bin/sh - set -eux - - # Create the ubuntu user account - getent group sudo >/dev/null 2>&1 || groupadd --system sudo - useradd --create-home -s /bin/bash -G sudo -U ubuntu - - - trigger: post-packages - action: |- - #!/bin/sh - set -eux - - # Make sure the locale is built and functional - locale-gen en_US.UTF-8 - update-locale LANG=en_US.UTF-8 - - # Cleanup underlying /run - mount -o bind / /mnt - rm -rf /mnt/run/* - umount /mnt - - # Cleanup temporary shadow paths - rm /etc/*- - -mappings: - architecture_map: debian diff --git a/doc/examples/voidlinux b/doc/examples/voidlinux deleted file mode 100644 index 6cc27ff..0000000 --- a/doc/examples/voidlinux +++ /dev/null @@ -1,81 +0,0 @@ -image: - distribution: voidlinux - description: Void Linux - expiry: 30d - architecture: x86_64 - -source: - downloader: voidlinux-http - url: http://alpha.de.repo.voidlinux.org/live/current - keys: - - CF24B9C038097D8A44958E2C8DEBDA68B48282A4 - -targets: - lxc: - create-message: | - You just created a Void Linux container (arch={{ image.architecture }}) - - config: - - type: all - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/voidlinux.common.conf - - - type: user - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/voidlinux.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 - -packages: - manager: xbps - - update: true - cleanup: true - - sets: - - packages: - - socklog-void - - cronie - action: install - -actions: - - trigger: post-packages - action: |- - #! /bin/sh - set -eux - - # Enable services - ln -s /etc/sv/socklog-unix /etc/runit/runsvdir/default/ - ln -s /etc/sv/nanoklogd /etc/runit/runsvdir/default/ - ln -s /etc/sv/dhcpcd-eth0 /etc/runit/runsvdir/default/ - ln -s /etc/sv/cronie /etc/runit/runsvdir/default/ - - # Disable services - for tty in 2 3 4 5 6; do - rm /etc/runit/runsvdir/default/agetty-tty${tty} - touch /etc/sv/agetty-tty${tty}/down - done - -mappings: - architecture_map: voidlinux diff --git a/doc/examples/voidlinux-musl b/doc/examples/voidlinux-musl deleted file mode 100644 index f68f800..0000000 --- a/doc/examples/voidlinux-musl +++ /dev/null @@ -1,82 +0,0 @@ -image: - distribution: voidlinux - description: Void Linux - expiry: 30d - architecture: x86_64 - -source: - downloader: voidlinux-http - url: http://alpha.de.repo.voidlinux.org/live/current - keys: - - CF24B9C038097D8A44958E2C8DEBDA68B48282A4 - variant: musl - -targets: - lxc: - create-message: | - You just created a Void Linux container (arch={{ image.architecture }}) - - config: - - type: all - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/voidlinux.common.conf - - - type: user - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/voidlinux.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 - -packages: - manager: xbps - - update: true - cleanup: true - - sets: - - packages: - - socklog-void - - cronie - action: install - -actions: - - trigger: post-packages - action: |- - #! /bin/sh - set -eux - - # Enable services - ln -s /etc/sv/socklog-unix /etc/runit/runsvdir/default/ - ln -s /etc/sv/nanoklogd /etc/runit/runsvdir/default/ - ln -s /etc/sv/dhcpcd-eth0 /etc/runit/runsvdir/default/ - ln -s /etc/sv/cronie /etc/runit/runsvdir/default/ - - # Disable services - for tty in 2 3 4 5 6; do - rm /etc/runit/runsvdir/default/agetty-tty${tty} - touch /etc/sv/agetty-tty${tty}/down - done - -mappings: - architecture_map: voidlinux diff --git a/doc/index.md b/doc/index.md index 7b0bf10..551ba72 100644 --- a/doc/index.md +++ b/doc/index.md @@ -125,3 +125,7 @@ $ lxc launch mycontainerimage c1 Creating c1 Starting c1 ``` + +### Examples + +Examples of yaml files for various distributions can be found [here](example.yaml) and in the [lxc-ci repository](https://github.com/lxc/lxc-ci/tree/master/images).
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel