LTS

    Innovation Version

      Shared Memory Channels

      Function Description

      System containers enable the communication between container and host processes through shared memory. You can set the --host-channel parameter when creating a container to allow the host to share the same tmpfs with the container so that they can communicate with each other.

      Parameter Description

      Command

      Parameter

      Value Description

      isula create/run

      --host-channel

      • Variable of the string type. Its format is as follows:
        <host path>:<container path>:<rw/ro>:<size limit>
      • The parameter is described as follows:

        <host path>: path to which tmpfs is mounted on the host, which must be an absolute path.

        <container path>: path to which tmpfs is mounted in a container, which must be an absolute path.

        <rw/ro>: permissions on the file system mounted to the container. The value can only be rw (read and write) or ro (read only). The default value is rw.

        <size limit>: maximum size used by the mounted tmpfs. The minimum value is one 4 KB physical page, and the maximum value is half of the total physical memory in the system. The default value is 64MB.

      Constraints

      • The lifecycle of tmpfs mounted on the host starts from the container startup to the container deletion. After a container is deleted and its occupied space is released, the space is removed.
      • When a container is deleted, the path to which tmpfs is mounted on the host is deleted. Therefore, an existing directory on the host cannot be used as the mount path.
      • To ensure that processes running by non-root users on the host can communicate with containers, the permission for tmpfs mounted on the host is 1777.

      Example

      Specify the --host-channel parameter when creating a container.

      [root@localhost ~]# isula run --rm -it --host-channel /testdir:/testdir:rw:32M --system-container --external-rootfs /root/myrootfs none init 
      root@3b947668eb54:/# dd if=/dev/zero of=/testdir/test.file bs=1024 count=64K 
      dd: error writing '/testdir/test.file': No space left on device 
      32769+0 records in 
      32768+0 records out 
      33554432 bytes (34 MB, 32 MiB) copied, 0.0766899 s, 438 MB/s
      

      NOTE:

      • If --host-channel is used for size limit, the file size is constrained by the memory limit in the container. (The OOM error may occur when the memory usage reaches the upper limit.)
      • If a user creates a shared file on the host, the file size is not constrained by the memory limit in the container.
      • If you need to create a shared file in the container and the service is memory-intensive, you can add the value of --host-channel to the original value of the container memory limit, eliminating the impact.

      Bug Catching

      Buggy Content

      Bug Description

      Submit As Issue

      It's a little complicated....

      I'd like to ask someone.

      PR

      Just a small problem.

      I can fix it online!

      Bug Type
      Specifications and Common Mistakes

      ● Misspellings or punctuation mistakes;

      ● Incorrect links, empty cells, or wrong formats;

      ● Chinese characters in English context;

      ● Minor inconsistencies between the UI and descriptions;

      ● Low writing fluency that does not affect understanding;

      ● Incorrect version numbers, including software package names and version numbers on the UI.

      Usability

      ● Incorrect or missing key steps;

      ● Missing prerequisites or precautions;

      ● Ambiguous figures, tables, or texts;

      ● Unclear logic, such as missing classifications, items, and steps.

      Correctness

      ● Technical principles, function descriptions, or specifications inconsistent with those of the software;

      ● Incorrect schematic or architecture diagrams;

      ● Incorrect commands or command parameters;

      ● Incorrect code;

      ● Commands inconsistent with the functions;

      ● Wrong screenshots.

      Risk Warnings

      ● Lack of risk warnings for operations that may damage the system or important data.

      Content Compliance

      ● Contents that may violate applicable laws and regulations or geo-cultural context-sensitive words and expressions;

      ● Copyright infringement.

      How satisfied are you with this document

      Not satisfied at all
      Very satisfied
      Submit
      Click to create an issue. An issue template will be automatically generated based on your feedback.
      Bug Catching
      编组 3备份