Create and Configure Docker Registry

Before you begin

If you are working on an offline system, you need to have required packages to be available. Perform the following steps to download the required packages on a machine that is connected to the internet and then manually copy the packages to the offline machine.
  1. In the machine that is connected to the internet, download the docker images registry:2.4.1 and hyper/docker-registry-web by using following commands.
    1. sudo docker pull registry:2.4.1
    2. sudo docker pull hyper/docker-registry-web
  2. Create a tar file for above docker images using following commands:
    1. sudo docker save -o registry.tar registry:2.4.1
    2. sudo docker save -o docker-registry-web.tar hyper/docker-registry-web
  3. Copy the above tar files to the offline system.
  4. After copying the tar files, load the files using following commands:
    1. sudo docker load -i registry.tar
    2. sudo docker load -i docker-registry-web.tar

About this task

Use this section to create and configure docker registry.

Procedure

  1. From the Plant Applications Enterprise Web Client installation package, download the DTR.zip file into the machine on which you want to run Docker Registry.
  2. Extract the DTR.zip file into a new pa-dtr folder by running following command: sudo unzip <downloaded_path>/DTR.zip -d pa-dtr. This folder stores the Docker Registry configuration files.
    Note: Ensure that you have enough space (minimum 20 GB) to store these extracted files.
  3. Create another folder named docker.service.d in the /etc/systemd/system folder by running the following command: sudo mkdir -p /etc/systemd/system/docker.service.d
  4. In the docker.service.d folder that you have created, create a file named http-proxy.conf by running the following command: sudo nano /etc/systemd/system/docker.service.d/http-proxy.conf
  5. Copy the following lines of code into the http-proxy.conf file, replacing the text in the angular brackets with the appropriate values:
    [Service]
    Environment="HTTP_PROXY=<proxy URL>:<port number of the proxy server>/""NO_PROXY=localhost,127.0.0.1,<IP address of the Docker Registry node>,<host name of the Docker Registry node>"
  6. Save the file and close it.
    Note: To save and close the file, enter ctrl+o and ctrl+x, respectively.
  7. Create a file named daemon.json in the following folder: /etc/docker
  8. Add the following lines of code in the daemon.json file:
    {
    "insecure-registries" : ["<IP address of the Docker Registry node>:5000","<host name of the Docker Registry node>:5000"]
    }                
  9. Run the following commands to verify that the proxy details that you have entered are correct:
    sudo systemctl daemon-reload
                        sudo systemctl restart docker
                        systemctl show --property=Environment docker                
  10. Using terminal, navigate to the pa-dtr folder.
  11. Access the .env file, and update the following parameters with the correct absolute path.
    • REGISTRY_WEB_CONFIG_VOLUME_PATH=/<absolute path>/pa-dtr/conf/registry-web
    • REGISTRY_WEB_DB_VOLUME_PATH=/<absolute path>/pa-dtr/conf/registry-web/db
    • REGISTRY_CONFIG_VOLUME_PATH=/<absolute path>/pa-dtr /pa-dtr/conf/registry
    • REGISTRY_DATA_VOLUME_PATH=/<absolute path>/pa-dtr/data
  12. In the pa-dtr folder, change the permission of the PA_DTR_Start_Lix.sh file to 775 by running the following command: sudo chmod 775 ./PA_DTR_Start_Lix.sh
  13. Access the PA_DTR_Start_Lix.sh file, and run the Shell script with sudo privileges: sudo ./PA_DTR_Start_Lix.sh. This is necessary to create and access the Docker registry.
  14. Go to the following locations to check if the Docker registry is created successfully:
    • Registry-url: http://<host name or IP address>:5000/v2/_catalog to verify that the registry is up and running.
    • Registry-web-url: http://<host name or IP address>:8080 to verify the docker images.
    Docker Registry is created. When prompted for the DTR URL during the installation of Plant Applications Enterprise Web Client, enter <host name of IP address of this local Docker Registry>:5000.
    Note: Do not enter http or https.