(Optional) Configuring Custom Mounted Content

Ascend Docker Runtime mounts the driver and all content in the basic configuration file /etc/ascend-docker-runtime.d/base.list by default. If you need to mount all paths in the file, skip this section. If you do not need to mount all content in base.list, you can add a custom configuration file to reduce the content to be mounted. The mounted content of the custom configuration file must be determined based on base.list. The operations are as follows:

  1. Go to the configuration file directory.
    cd /etc/ascend-docker-runtime.d/

    base.list exists in the directory, and the content is the default mounted objects of Ascend Docker Runtime. For details, see Default Content Mounted by Ascend Docker Runtime. In principle, base.list cannot be modified.

  2. Create a new configuration file. The file name can be customized, for example, hostlog.list.
    vi hostlog.list
  3. Write the files or directories to be mounted to hostlog.list, save the file, and exit.
  4. Make the hostlog.list file take effect. Example:
    docker run --rm -it -e ASCEND_VISIBLE_DEVICES=0 -e ASCEND_RUNTIME_MOUNTS=hostlog image-name:tag /bin/bash

    For details about ASCEND_VISIBLE_DEVICES and ASCEND_RUNTIME_MOUNTS, see Table 1.