Create and Configure Docker Registry

About this task

Use this section to create and configure docker registry.

Procedure

  1. From the Plant Applications Enterprise Edition Web Client installation package, download the DTR2023 folder to the machine on which you want to run Docker Registry.
    Note: It is not mandatory to have local registry DTR2023. However, due to security concerns, we recommend to have a new local registry (DTR2023).
    Note: Ensure that you have enough space (minimum 50 GB) to store these extracted files.
  2. 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
  3. In the docker.service.d folder that you have created, create a file named http\u0002proxy.conf by running the following command:
    sudo nano /etc/systemd/system/docker.service.d/http-proxy.conf
  4. 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>:\
    <proxy port number>"
    Environment="NO_PROXY=localhost,127.0.0.1,\
    <Docker Registry IP address>,\
    <Docker Registry hostname>"
     
  5. Save the file and close it.
    Note: To save and close the file, enter Ctrl+O and Ctrl+X, respectively.
  6. Create a file named daemon.json in the following folder: /etc/docker
  7. 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"]
    }                
  8. Run the following commands to restart the docker:
    sudo systemctl restart docker
  9. Using terminal, change directory (cd) to the DTR2023 folder.
  10. Edit the hidden .env file and update the following parameters with the correct absolute path.
    • REGISTRY_WEB_CONFIG_VOLUME_PATH=/<absolute path to DTR2023 dir>/conf/registry-web
    • REGISTRY_WEB_DB_VOLUME_PATH=/<absolute path to DTR2023 dir>/conf/registry-web/db
    • REGISTRY_CONFIG_VOLUME_PATH=/<absolute path to DTR2023 dir>/pa-dtr/conf/registry
    • REGISTRY_DATA_VOLUME_PATH=/<absolute path to DTR2023 dir>/data
  11. In the DTR2023 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.
  12. Execute the PA_DTR_Start_Lix.sh Shell script with sudo privileges: sudo ./PA_DTR_Start_Lix.sh. The output of the command looks similar to the following:
    [DTR2023]$ sudo ./PA_DTR_Start_Lix.sh 
    Error response from daemon: No such image: hyper/docker-registry-web:latest
    994393dc58e7: Loading layer[==================================================>]  5.827MB/5.827MB
    0a884882e8e9: Loading layer [==================================================>]  773.6kB/773.6kB
    08b517d298ee: Loading layer [==================================================>]  18.09MB/18.09MB
    b728e2a2a5ff: Loading layer [==================================================>]  4.096kB/4.096kB
    5d76c6550425: Loading layer [==================================================>]  2.048kB/2.048kB
    Loaded image: registry:2.8.1
    Error response from daemon: network with name paWeb-DTR-attachable-overlay already exists
    Error response from daemon: network with name MES_Services_PADtr already exists
    Creating service PARegistry_registry
    
    
    
  13. Add the following to the Registry-url bullet. You should see the following text returned by the web server: {"repositories":[]}