mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-28 16:27:50 +00:00
docs: Add a Usage section
Add a new Usage section with basic examples of how to run the builders from the `Makefile`. Fixes #84. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
parent
3e0e112e2b
commit
3c19ea413e
80
README.md
80
README.md
@ -4,6 +4,14 @@
|
|||||||
|
|
||||||
* [Introduction](#introduction)
|
* [Introduction](#introduction)
|
||||||
* [Terms](#terms)
|
* [Terms](#terms)
|
||||||
|
* [Usage](#usage)
|
||||||
|
* [Rootfs creation](#rootfs-creation)
|
||||||
|
* [Rootfs with systemd as init](#rootfs-with-systemd-as-init)
|
||||||
|
* [Rootfs with the agent as init](#rootfs-with-the-agent-as-init)
|
||||||
|
* [Image creation](#image-creation)
|
||||||
|
* [Image with systemd as init](#image-with-systemd-as-init)
|
||||||
|
* [Image with the agent as init](#image-with-the-agent-as-init)
|
||||||
|
* [Initrd creation](#initrd-creation)
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
@ -20,10 +28,9 @@ This section describes the terms used for all documentation in this repository.
|
|||||||
|
|
||||||
- rootfs
|
- rootfs
|
||||||
|
|
||||||
The root filesystem or "rootfs" is the set of files contained in the
|
The root filesystem or "rootfs" is a slight misnomer as it is not a true filesystem. It is a tree of files contained in a particular directory, which represents the root disk layout. A rootfs can be turned into either an image or an initrd.
|
||||||
guest root directory that builds into a filesystem.
|
|
||||||
|
|
||||||
See [the rootfs builder documentation](rootfs-builder/README.md).
|
See the [rootfs creation](#rootfs-creation) section.
|
||||||
|
|
||||||
- "Guest OS" (or "Guest Image")
|
- "Guest OS" (or "Guest Image")
|
||||||
|
|
||||||
@ -32,16 +39,71 @@ This section describes the terms used for all documentation in this repository.
|
|||||||
create an environment to host the container. Neither the guest OS nor the
|
create an environment to host the container. Neither the guest OS nor the
|
||||||
guest kernel need to be the same as the host operating system.
|
guest kernel need to be the same as the host operating system.
|
||||||
|
|
||||||
See [the image builder documentation](image-builder/README.md).
|
See the [image creation](#image-creation) section.
|
||||||
|
|
||||||
- initrd (or "initramfs")
|
- initrd (or "initramfs")
|
||||||
|
|
||||||
A compressed cpio archive loaded into memory and used as part of the Linux
|
A compressed `cpio(1)` archive, created from a rootfs which is loaded into memory and used as part of the Linux startup process. During startup, the kernel unpacks it into a special instance of a `tmpfs` that becomes the initial root filesystem.
|
||||||
startup process. During startup, the kernel unpacks it into a special
|
|
||||||
instance of a tmpfs that becomes the initial root file system.
|
|
||||||
|
|
||||||
See [the initrd builder documentation](initrd-builder/README.md).
|
See the [initrd creation](#initrd-creation) section.
|
||||||
|
|
||||||
- "Base OS"
|
- "Base OS"
|
||||||
|
|
||||||
A particular version of a Linux distribution used to create a Guest OS from.
|
A particular version of a Linux distribution used to create a rootfs from.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
The top-level `Makefile` contains an example of how to use the available components.
|
||||||
|
|
||||||
|
By default, components will run on the host system. However, some components
|
||||||
|
offer the ability to run from within Docker (for ease of setup) by setting the
|
||||||
|
`USE_DOCKER=true` variable.
|
||||||
|
|
||||||
|
For more detailed information, consult the documentation for a particular component.
|
||||||
|
|
||||||
|
### Rootfs creation
|
||||||
|
|
||||||
|
This section shows how to build a basic rootfs using the default distribution.
|
||||||
|
For further details, see
|
||||||
|
[the rootfs builder documentation](rootfs-builder/README.md).
|
||||||
|
|
||||||
|
#### Rootfs with systemd as init
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo -E PATH=$PATH make USE_DOCKER=true rootfs
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Rootfs with the agent as init
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo -E PATH=$PATH make USE_DOCKER=true AGENT_INIT=yes rootfs
|
||||||
|
```
|
||||||
|
|
||||||
|
### Image creation
|
||||||
|
|
||||||
|
This section shows how to create an image from the already-created rootfs. For
|
||||||
|
further details, see
|
||||||
|
[the image builder documentation](image-builder/README.md).
|
||||||
|
|
||||||
|
#### Image with systemd as init
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo -E PATH=$PATH make USE_DOCKER=true image-only
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Image with the agent as init
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo -E PATH=$PATH make USE_DOCKER=true AGENT_INIT=yes image-only
|
||||||
|
```
|
||||||
|
|
||||||
|
### Initrd creation
|
||||||
|
|
||||||
|
To create an initrd from the already-created rootfs with the agent acting as the init daemon:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo -E PATH=$PATH make AGENT_INIT=yes initrd-only
|
||||||
|
```
|
||||||
|
|
||||||
|
For further details,
|
||||||
|
see[the initrd builder documentation](initrd-builder/README.md).
|
||||||
|
Loading…
Reference in New Issue
Block a user