To install and manage the software containers by using Docker, you must follow the
instructions in this topic to install the prerequisite software.
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.5.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 26.0.0
- Docker CLI 26.0.0
- Docker Compose 2.25.0
- containerd 1.7.14
- runc 1.1.12
The package extracts itself and completes the following steps:
- It installs all prerequisites into the /usr/local directory.
- It creates a
dockerroot
user ID, if this user ID does not exist.
- It configures the Docker daemon as a systemd service, and it starts this service.
Procedure
Complete the following steps for installing the Docker CE engine, Docker CLI, and
Docker Compose on Linux.
-
Create a nonadministrative user ID, such as
zdapuser
, as shown in the
following example:
useradd -m zdapuser
passwd zdapuser
- 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
-
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.
- Go to the prereqs subdirectory in the temporary installation
directory, as shown in the following example:
cd temp_install_dir/prereqs # for TAR file
-
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.5.run --remove
# To install the current Docker prerequisites
./docker_prereqs-v2.5.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
-
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
-
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.
-
To verify that the correct versions of all prerequisites are installed in the
/usr/local/bin directory, repeat Step 3.
-
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.
-
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.
- Optional: If you plan to deploy the Z Data Analytics Platform on z/OS® Container Extensions (zCX), and if Docker engine, Docker
CLI, and their prerequisites are already installed, then you must install only Docker Compose. You
can perform the following steps:
- Go to the prereqs subdirectory in the temporary installation directory, as
shown in the following
example:
cd temp_install_dir/prereqs # for TAR file
- Run the following commands, and then follow the instructions in the command
line:
# If you previously installed an older version of Docker Compose
./docker_prereqs-v2.5.run --remove-zcx
# To install the current Docker Compose prerequisite
./docker_prereqs-v2.5.run --install-zcx
As a result, the Docker Compose plug-in is
installed in the zCX user ID's Docker plug-in directory
(${HOME}/.docker/cli-plugins/).
- Verify whether Docker Compose is correctly
installed:
docker compose version
Important: The creation of a
nonadministrative user ID is not necessary or possible when you deploy on zCX. Instead, you can use
the user ID that is configured for the zCX instance for all deployment, administrative, and
operational tasks that reference the zdapuser user ID in this documentation.