Pinning to explicit image versions provides greater control over which version runs in your deployment. Follow these steps to pin an explicit image reference:

  1. Set the desired image tag or digest:
    $ServerImageReference = 'openedge-mcp-server:<version>'
  2. Apply the image reference to the generated profile compose file:
    # Update profile compose file
    $ComposePath = "generated\$Profile\docker-compose.mcp.yml"
    (Get-Content -LiteralPath $ComposePath) `
      -replace '^(\s*)image:.*
    #39;, ('${1}image: ' + $ServerImageReference) | Set-Content -LiteralPath $ComposePath
  3. Apply the same image reference to the production export compose file:
    $ExportComposePath = 'exports\export_<profile>_<timestamp>\docker-compose.mcp.yml'
    $UpdatedContent = Get-Content -LiteralPath $ExportComposePath
    $UpdatedContent = $UpdatedContent -replace '^(\s*)image:.*
    #39;, ('${1}image: ' + $ServerImageReference) Set-Content -LiteralPath $ExportComposePath -Value $UpdatedContent
  4. Recreate the container to apply the image reference change:
    • For standard profiles:
      Set-Location $env:OEMCP_HOME
      .\mcpgen.ps1 stop $Profile
      .\mcpgen.ps1 start $Profile
      
      # Verify the container uses the pinned image
      docker inspect --format '{{.Config.Image}}' "$Profile"
    • For production exports:
      Set-Location 'exports\export_<profile>_<timestamp>'
      .\run.ps1 stop -Port <port> -Name <container-name>
      .\run.ps1 start -Port <port> -Name <container-name>
      
      # Verify the container uses the pinned image
      docker inspect --format '{{.Config.Image}}' <container-name>
    Note: Editing the compose file does not change already-running containers. The container must be stopped and restarted for the new image reference to take effect.