Preparing Docker Volumes

A docker volume (commonly referred as data volume) is a specially-designated directory within one or more containers that bypasses the Union File System. Docker volumes provide several useful features for persistent and shared data. Docker volumes can be shared and reused among containers.

Docker volumes persist even if the container itself is deleted. You can create a docker volume container from an existing image. The volume container has the mapping of the host's directory to the container. For further information, refer to the Docker documentation on volume.
Before you start running the Docker containers, you are required to have the following directories on the host machine:
  • The $AF_HOME/roles/configurator/standalone/config directory. This directory contains all the configuration files required by the Configurator server; this directory is mapped as a data volume inside the fom-configurator docker containers.
    Note: All the other containers refer to the database to access any of the property files.
  • The model loading directories. These are the directories setup to load the product, planfragment, action, price and discount models. These models are loaded by the OMS server and no other container needs this volume mapping other than the OMS server container.
  • A logs directory that you must create.

Procedure

  • Create a logs directory where logs from all the containers will be available on your host machine. For example, $AF_HOME/logs.
    Note: Since the Docker container will read and write in the three directories mentioned, it is mandatory to give read and write privilege to others on the host machine on the directories where you are creating volumes. Since Docker is writing to the existing files in the volume, each file in the volume must have read and write privileges. For example:
     $] chmod o+rw -R
    $AF_HOME/roles/configurator/standalone/config