Specifying Rootfs to Create a Container

Function Description

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.

Parameter Description

Command

Parameter

Value Description

isula create/run

--external-rootfs

  • Variable of the string type.
  • Absolute path in the root file system of the container, that is, the path of rootfs.

Constraints

  • 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.

Example

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

NOTE:
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.

Rating

search results about are found