1
0
mirror of https://github.com/rancher/os.git synced 2025-05-08 16:16:20 +00:00
os/scripts/installer
Sven Dowideit 62d8aaa58e Need to remove the immutable bit from ldlinux.sys so root can remove it
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-03-31 12:15:15 +00:00
..
conf ros install 2015-08-25 17:20:40 +05:00
BaseDockerfile.amd64 Need to remove the immutable bit from ldlinux.sys so root can remove it 2017-03-31 12:15:15 +00:00
Dockerfile.amd64 add --debug logging option to installer, and a dummy set-disk-partitions 2017-01-18 10:50:37 +10:00
Dockerfile.arm64 Changes needed to get the arm and arm64 builds working 2016-11-25 10:10:21 +10:00
lay-down-os Installing 0.7.1, and then rebooting, and doing a ros upgrade to a faked up latest works \o/ 2017-01-15 23:40:18 +00:00
README.md readme from os-installer 2015-09-14 19:38:16 +05:00
seed-data Avoid hardcoded reference to /scripts 2015-11-25 18:33:24 +01:00
set-disk-partitions gpt disk in BIOS boot mode 2016-12-14 22:04:31 +10:00

rancher/os installer container

The container can be used directly, but there is a wrapper in RancherOS CLI, ros install, that handles calling things in the right order.

##Basics

When booting from the ISO file RancherOS runs completely from memory. In order to run more containers, and save state between reboots, you need to persist and run from disk.

When booting, RancherOS looks for a device labeled "RANCHER_STATE". If it finds a volume with that labeled the OS will mount the device and use it to store state.

The scripts in this container will create a device labeled RANCHER_STATE and make it bootable. The two supported methods, are generic and amazon-ebs. The approach can be translated to suit different needs.

The generic install type follows these steps:

  1. ) partition device with a single partition the size of the disk.
  2. ) format ext4 and label partition as RANCHER_STATE
  3. ) Install grub2 on device
  4. ) Place kernel/initrd and grub.cfg inside /boot on the device.
  5. ) Seeds the cloud-init data so that a ssh key or other RancherOS configuration can be set.

The amazon-ebs approach follows these steps:

  1. ) format the device (Ext4) and label RANCHER_STATE
  2. ) Add PV-GRUB configuration (menu.lst)
  3. ) Add Kernel and Initrd
  4. ) Sets Rancher to look for EC2 cloud-init data.

Usage

Warning: Using this container directly can be like running with scissors...

 # Partition disk without prompting of any sort:
 docker run --privileged -it --entrypoint=/scripts/set-disk-partitions rancher/os:<version> <device>


 # install 
 docker run --privileged -it -v /home:/home -v /opt:/opt \
        rancher/os:<version> -d <device> -t <install_type> -c <cloud-config file> \
        -i /custom/dist/dir \
        -f </src/path1:/dst/path1,/src/path2:/dst/path2,/src/path3:/dst/path3>

The installation process requires a cloud config file. It needs to be placed in either /home/rancher/ or /opt/. The installer make use of the user-volumes to facilitate files being available between system containers. -i and -f options are, well, optional.

By providing -i (or DIST env var) you specify the path to your custom vmlinuz and initrd.

-f allows you to copy arbitrary files to the target root filesystem.

Contact

For bugs, questions, comments, corrections, suggestions, etc., open an issue in rancher/os with a title starting with [os-installer] .

Or just click here to create a new issue.