[Docker-based] Installing prerequisite software

To install and manage the software containers by using Docker, you must follow the instructions in this topic to install the prerequisite software.

Before you begin

Follow the steps that are described at Obtaining and preparing the installation files to prepare the installation files.

About this task

If you want to use Docker CE engine, Docker CLI, and Docker Compose but cannot access the correct versions of the prerequisite software packages from the repositories of your Linux® operating system provider, you can use the convenience package docker_prereqs-v2.run that is provided on the Z Operational Log and Data Analytics media (LC28-3255). This convenience package includes the prerequisites in an easy-to-install form.

The convenience package contains the following software:
  • Docker engine 23.0.2
  • Docker CLI 23.0.2
  • Docker Compose 2.17.2
  • containerd 1.7.0
  • runC 1.1.5
The package extracts itself and completes the following steps:
  1. It installs all prerequisites into the /usr/local directory.
  2. It creates a dockerroot user ID, if this user ID does not exist.
  3. It configures the Docker daemon as a systemd service, and it starts this service.


Complete the following steps for installing the Docker CE engine, Docker CLI, and Docker Compose.

  1. Create a nonadministrative user ID, such as zdapuser, as shown in the following example:
    useradd -m zdapuser
    passwd zdapuser
  2. Optional: Enable sudo all authority for the new user ID, as shown in the following example command:
    usermod -aG wheel zdapuser # typical for RHEL
    usermod -aG sudo zdapuser  # typical for Ubuntu
  3. Check whether the required versions of Docker or Docker Compose are installed by running the following commands:
    which docker             # to determine whether Docker is installed
    docker version           # to determine Docker version
    docker compose version   # to determine Docker Compose version

    If the required versions of both tools are installed, this procedure is complete. Otherwise, continue with the next step. If you enabled sudo all for the user ID zdapuser, use that user ID. If you did not enable sudo all for the user ID zdapuser, continue as the root user.

  4. Go to the prereqs subdirectory in the temporary installation directory, as shown in the following example:
    cd temp_install_dir/prereqs   # for TAR file
  5. Run the following commands, and follow the instructions in the command prompt:
    # If you previously installed an older version of the Docker prerequisites
    ./docker_prereqs-v2.run --remove
    # To install the current Docker prerequisites
    ./docker_prereqs-v2.run --install
    After you complete the installation, verify that the /usr/local/bin directory is in the default system path for all users on the system. Also, to the newly created docker user group, you must manually add zdapuser and any other user IDs that must interact with the Docker daemon via the Docker CLI.
    usermod -aG docker zdapuser
  6. Verify that the Docker-related services are activated, as shown in the following example:
    sudo systemctl status docker
    sudo systemctl status docker.socket
    sudo systemctl status containerd
  7. Log in as zdapuser. If you are already logged in under this user ID, log out, and log in again to make the most recent account changes take effect.
  8. To verify that the correct versions of all prerequisites are installed in the /usr/local/bin directory, repeat Step 3.
  9. Verify that zdapuser can communicate with the Docker daemon by running the following command:
    docker images -a

    A list of images should be returned. This list might be empty if no Docker images were previously installed on this system. If you receive an error message, verify that zdapuser is added to the docker group, or refresh the zdapuser login session.

  10. Verify that the Docker root directory is on a file system with adequate disk space by running the following command:
    DOCKERROOT=`docker info -f '{{ .DockerRootDir }}'`
    df -h ${DOCKERROOT}

    The default location of the Docker root directory is /var/lib/docker. If the file space in the Docker root directory is not adequate, you must relocate the directory. For more information, see Relocating the Docker root directory.