Git Product home page Git Product logo

infra-devops's Introduction

Kickstart to RootFS Builder

This project provides the ability build rootfs file from kickstart input file in a docker/podman container environment. Output rootfs files can be used create base images for different OSs (AlmaLinux, Cent OS, Rocky Linux) etc.

Building local

Two different variants of the image almalinux/ks2rootfs are avilable.

Building almalinux/ks2rootfs:latest image tag

Use follwing command latest tag image to create rootfs files for docker and WSL images.

docker build -t almalinux/ks2rootfs -f Dockerfile .

Building almalinux/ks2rootfs:livecd-tools image tag

Use follwing command livecd-tools tag image to create SIG/LiveMedia ISO images, check GitHub repo.

docker build -t almalinux/ks2rootfs:livecd-tools -f Dockerfile.livecd .

Using almalinux/ks2rootfs:latest image tag

Use latest tag image to create rootfs files for docker and WSL images.

Using lastet Image tag

Run following command under tests folder. Test script kickstart files are available at kickstarts. NOTE: These scripts test use only. Official docker image kickstart files are avaialble in GitHub docker-images repository.

Use command below to create default docker files

docker run --rm --privileged -v "$PWD:/build:z" \
    -e KICKSTART_FILE=kickstarts/almalinux-8-default.x86_64.ks \
    -e IMAGE_NAME=almalinux-8-docker-default.x86_64.tar.gz \
    -e OUTPUT_DIR=default \
    -e BUILD_TYPE=default \
    almalinux/ks2rootfs

Use command below to create base docker files

docker run --rm --privileged -v "$PWD:/build:z" \
    -e KICKSTART_FILE=kickstarts/almalinux-8-base.x86_64.ks \
    -e IMAGE_NAME=almalinux-8-docker-base.x86_64.tar.gz \
    -e OUTPUT_DIR=base \
    -e BUILD_TYPE=base \
    almalinux/ks2rootfs

Use command below to create init docker files

docker run --rm --privileged -v "$PWD:/build:z" \
    -e KICKSTART_FILE=kickstarts/almalinux-8-init.x86_64.ks \
    -e IMAGE_NAME=almalinux-8-docker-init.x86_64.tar.gz \
    -e OUTPUT_DIR=init \
    -e BUILD_TYPE=init \
    almalinux/ks2rootfs

Environment variables

Container startup script ks2rootfs supports multiple environment varible to customize the output. The environment variables and their use as follows

ENVIRONMENT VARIABLES:
======================

KICKSTART_FILE  : Reuired - Input kickstart source file (.ks)
IMAGE_NAME     : Required - Rootfs output file name 

BUILD_WORK_DIR   : Optional - Working dir for kickstart source and image destination. Defaults to current directory.
OUTPUT_DIR     : Optional - Output directory name in working directory. Ddefault value is 'result'.
FLAG_OUTOUT_IN_PWD : Optional - Set this flag to true to write output files in current working directory. Default value is 'false'. When value is set to 'true', any value passed to 'OUTPUT_DIR' will be ignored.
FLAG_WRITE_META    : Optional - Generate meta data about the kickstart build system. Default value is 'true'.
FLAG_RETAIN_LOG    : Optional - When enabled, generated logs files retained under 'logs' output directory. Default value is 'false'.
BUILD_COMPTYPE     : Optional - Build compression type default 'xz', 'gzip' and 'lzma'.
BUILD_TYPE         : Optional - Build type 'base', 'default', 'init', 'micro', 'minimal' and 'wsl', Default value is 'default'.

USAGE:
    ks2rootfs KICKSTART_FILE_NAME ROOTFS_FILE_NAME

EXAMPLES:
    ks2rootfs os-minimal.ks os-minimal.tar.gz

Using almalinux/ks2rootfs:livecd-tools Image

livecd-tools tag image to create SIG/LiveMedia ISO images, check GitHub repo for more detailed use.

infra-devops's People

Contributors

srbala avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

infra-devops's Issues

Missing kickstart file for almalinux-8-init

I was trying the steps for the init Docker files, but the kickstart file seems to be missing to be able to complete those steps.
I first built the Docker image, that went perfectly fine. But the next step failed:

podman run --rm --privileged -v "$PWD:/build:z" \
    -e KICKSTART_FILE=kickstarts/almalinux-8-init.x86_64.ks \
    -e IMAGE_NAME=almalinux-8-docker-init.x86_64.tar.gz \
    -e OUTPUT_DIR=init \
    -e BUILD_TYPE=init \
    almalinux/ks2rootfs
Build output files will be in './result_x86_64' folder ...
Output directory ./result_x86_64 created successfully

ks2rootfs - Script input summary:

FLAGS
-----
FLAG_OUTOUT_PWD : false
FLAG_WRITE_META : false
FLAG_RETAIN_LOG : false

VARIABLES
---------
BUILD_WORK_DIR  : ./
OUTPUT_DIR      : ./result_x86_64
BUILD_LOGDIR    : ./result_x86_64/logs
INPUT_KICKSTART : ./kickstarts/almalinux-8-init.x86_64.ks
OUTPUT_ROOTFS   : ./result_x86_64/almalinux-8-docker-init.x86_64.tar.gz
BUILD_COMPTYPE  : xz
BUILD_TYPE      : init
2022-02-09 14:57:53,298: livemedia-creator v28.14.62-1
2022-02-09 14:57:53,299: selinux is Disabled
2022-02-09 14:57:53,300: kickstart file (/build/kickstarts/almalinux-8-init.x86_64.ks) is missing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.