Specifying Rootfs to Create a Container
Different from a common container that needs to be started by specifying a container image, a system container is started by specifying a local root file system (rootfs) through the –external-rootfs parameter. Rootfs contains the operating system environment on which the container depends during running.
- The rootfs directory specified by the –external-rootfs parameter must be an absolute path.
- The rootfs directory specified by the –external-rootfs parameter must be a complete OS environment. Otherwise, the container fails to be started.
- When a container is deleted, the rootfs directory specified by –external-rootfs is not deleted.
- Containers based on ARM rootfs cannot run on x86 servers. Containers based on x86 rootfs cannot run on ARM servers.
- You are not advised to start multiple container instances by using the same rootfs. That is, one rootfs is used only by container instances in the same lifecycle.
If the local rootfs path is /root/myrootfs, run the following command to start a system container:
# isula run -tid --system-container --external-rootfs /root/myrootfs none init
Rootfs is a user-defined file system. Prepare it by yourself. For example, a rootfs is generated after the TAR package of container images is decompressed.