Get ID in HOOK_preprocess_container I'm currently working a styling of a drupal 8 website. And I'm trying two things.

In HOOK_preprocess_container I want to output a block, I got the block script figured out but I want to filter and output only when the Container ID matches a certain ID. Can someone help me out with this?

Thanks in advance.

My current HOOK:

function HOOK_preprocess_container(&amp;$variables) {
  //something like this
  $containerID = //get container ID;

  $block = \Drupal\block\Entity\Block::load('block_id');
  $block_content = \Drupal::entityTypeManager()
    -&gt;getViewBuilder('block')
    -&gt;view($block);

  if($containerID == "containerID"){
    $variables['containerblock'] = $block_content;
  }
}
You should be able to get that with:

$container_id = $variables['element']['#id'];