#!/bin/bash

# Docker installation type specific LibrePortal tag replacements
# Now uses universal tag manager instead of sed operations

tagsProcessorDockerInstallation()
{
    local full_file_path="$1"
    local CFG_DOCKER_INSTALL_TYPE="$2"
    local CFG_DOCKER_INSTALL_USER="$3"
    
    if [[ $CFG_DOCKER_INSTALL_TYPE == "rootless" ]]; then
        local docker_install_user_id=$(id -u "$CFG_DOCKER_INSTALL_USER")
        
        # Use universal tag manager for all replacements
        tagsManagerUpdateUniversalTag "$full_file_path" "DOCKERINSTALLUSER_TAG" "$docker_install_user_id"
        tagsManagerUpdateUniversalTag "$full_file_path" "UID_TAG" "$docker_install_user_id"
        tagsManagerUpdateUniversalTag "$full_file_path" "GID_TAG" "$docker_install_user_id"
        
        # Enable user directive (non-tag replacement)
        runFileOp sed -i 's|#user:|user:|g' "$full_file_path"
        
        checkSuccess "Docker rootless installation tags applied using universal tag manager"
    fi
}
