osctl-image - build, test and deploy vpsAdminOS container images
osctl-image [global options] command [command options] [arguments...]
osctl-image manages containers that serve as builders and uses them to
build container images. osctl-image itself does not know how to build
images. It is concerned with managing build containers, executing arbitrary
builds and testing resulting images.
osctl-image has to be used in conjunction with program or programs that know
how to build specific distribution images. vpsAdminOS comes with one such
collection of image building scripts:
https://github.com/vpsfreecz/vpsadminos/tree/staging/image-scripts.
See IMAGE BUILDER INTERFACE for more information about the interaction
of osctl-image with image building programs.
--build-scripts directory/etc/vpsadminos-image-scripts.ls [options] -H, --hide-header
Do not show header, useful for scripts.
-L, --list
List available parameters and exit.
-o, --output parameters
Select parameters to output, see OUTPUT PARAMETERS in osctl(8) for more
information.
-s, --sort parameters
Sort output by parameters, comma separated.
build [options] all|image[,image...] --build-dataset dataset
Name of a ZFS filesystem which can be used to build images. Required.
--output-dir dir
Directory where the resulting images are stored. Defaults to ./output.
--vendor vendor
Override vendor attribute defined by the image.
--jobs n
How many images should be built in parallel. Defaults to 1.
test [options] all|image[,image...] [test[,test...]]--rebuild. --build-dataset dataset
Name of a ZFS filesystem which can be used to build images. Required.
--output-dir dir
Directory where the resulting images are stored. Defaults to ./output.
--vendor vendor
Override vendor attribute defined by the image.
--rebuild
Rebuild the image even if it is found in the output directory.
--keep-failed
Keep containers from failed tests.
instantiate [options] image--rebuild. --build-dataset dataset
Name of a ZFS filesystem which can be used to build images. Required.
--output-dir dir
Directory where the resulting images are stored. Defaults to ./output.
--vendor vendor
Override vendor attribute defined by the image.
--rebuild
Rebuild the image even if it is found in the output directory.
--container ctid
Do not create a new container, but reinstall container ctid to
image. Configuration of the existing container is kept.
deploy [options] image[,image...] repository--rebuild is used.
repository is a directory managed by osctl-repo. --build-dataset dataset
Name of a ZFS filesystem which can be used to build images. Required.
--output-dir dir
Directory where the resulting images are stored. Defaults to ./output.
--vendor vendor
Override vendor attribute defined by the image.
--tag tag
Tag the image within the repository. Tags can be used to access the
image instead of using its version. Used tags include stable, latest
and testing.
--jobs n
How many images should be built in parallel. Defaults to 1.
--rebuild
Rebuild the image even if it is found in the output directory.
--keep-failed
Keep containers from failed tests.
--skip-tests
Do not run tests, deploy images immediately after build.
ct ls [options] -H, --hide-header
Do not show header, useful for scripts.
-L, --list
List available parameters and exit.
-o, --output parameters
Select parameters to output, see OUTPUT PARAMETERS in osctl(8) for more
information.
-s, --sort parameters
Sort output by parameters, comma separated.
ct del [options] [ctid...] --type builder|test|instance
Delete only containers of selected type.
-f, --force
Do not ask for confirmation, delete the containers right away.
Image building programs define builders and actual images to be built. Builders are simply containers in which the images are built.
osctl-image requires three executable files in the build scripts
directory: bin/config, bin/runner and bin/test.
bin/config is used to gather information about builders and images. It is
called from the vpsAdminOS host.
bin/runner is used to either setup builders or build images. It is called
within build containers managed by osctl-image.
bin/test is used to test built images. It is run on the vpsAdminOS host
and can use osctl to test containers managed by osctl-image. Since
the tests may require additional programs, bin/test is invoked by a nix-shell
operating on ./shell-test.nix. You can configure your dependencies in this Nix
file.
All executables have to implement argument-based commands described below.
bin/config builder listbin/config builder show name<attribute>=<value>.bin/config image listbin/config image show name<attribute>=<value>.bin/runner builder setup namebin/runner image build build-id work-dir install-dir name/container.yml.bin/test image run image test ctid0.DISTNAMERELVERARCHVENDORVARIANTBUILDERDISTNAMERELVERARCHVENDORVARIANTOnly BUILDER is required. Other attributes can be passed within the image
name in the following form: DISTNAME[-RELVER[-ARCH[-VENDOR[-VARIANT]]]]
Report bugs to https://github.com/vpsfreecz/vpsadminos/issues.
osctl-image is a part of vpsAdminOS.