Rate This Document
Findability
Accuracy
Completeness
Readability

(Optional) Configuring the Docker Environment

Docker is not within the delivery scope of this solution. The environment configuration provided in this section is for reference only. You are advised not to use the Kunpeng BoostKit for Cloud Phone demos as a commercial solution. Customers or ISVs must perform necessary security assessment before commercial use. Use of the Kunpeng BoostKit for Cloud Phone demos implies the user's acceptance of all associated security risks.

Creating a Separate Partition and Enabling IPv6 for Containers

  1. The default Docker directory is /var/lib/docker, which stores all Docker files including images. This directory may be fully occupied. As a result, Docker and the host may become unavailable. For this reason, it is a good practice to create a separate partition (logical volume) for Docker files.
  2. By default, IPv6 is disabled for Docker. However, some applications depend on the IPv6 protocol. If IPv6 is disabled, some functions of these applications may be abnormal. The following provides a method to enable the IPv6 protocol for Docker.

Recommended modification method:

  1. Create a directory for Docker files. Mount an idle drive whose file system type is ext4 as a separate partition. The following uses sda as an example.

    Create a /root/sda/docker directory and add a line /dev/sda /root/sda/docker ext4 defaults 0 0 to the /etc/fstab file. If /dev/sda has been mounted or it has a non-ext4 file system, replace sda in the following command with the name of a valid drive.

    1
    2
    mkdir -p /root/sda/docker
    echo "/dev/sda /root/sda/docker ext4 defaults 0 0" >> /etc/fstab
    
  2. Go to the /root/sda/docker path.
    1. Open the /etc/docker/daemon.json file.
      1
      vim /etc/docker/daemon.json
      
    2. Press i to enter the insert mode and add the "data-root": "/root/sda/docker", "ipv6": true,"fixed-cidr-v6": "2001:db8::/64" properties to the file to configure the Docker data storage location and enable the IPv6 protocol. The file must comply with the JSON format.
      1
      2
      3
      4
      5
      6
      {
      "debug": true,
      "data-root": "/root/sda/docker",
      "ipv6": true,
      "fixed-cidr-v6": "2001:db8::/64"
      }
      
    3. Press Esc, type :wq!, and press Enter to save the file and exit.

    Modify the /etc/docker/daemon.json file. If the file does not exist, run the following commands to create the file and write related content to the file:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    touch /etc/docker/daemon.json
    cat >/etc/docker/daemon.json <<EOF
    {
    "debug":true,
    "data-root":"/root/sda/docker",
    "ipv6":true,
    "fixed-cidr-v6":"2001:db8::/64"
    }
    EOF
    
  3. Restart the Docker service.

    Before restarting the Docker service, ensure that no other container is running. If any other container is running in the environment, clear it.

    1
    systemctl restart docker
    
  4. Reload the content of the /etc/fstab file.
    1
    mount -a