prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  CKV_DOCKER_11 false positive when `--platform` is used
  **Describe the issue**
  
  CKV_DOCKER_11 false positive when `--platform` is used (possibly other arguments as well)
  
  For reference: _"CKV_DOCKER_11: "Ensure From Alias are unique for multistage builds."_  In other words, make sure you add `as myAlias` at the end of your `FROM` line
  
  **Examples**
  
  This will PASS as expected:
  `FROM node:16 as build`
  
  Now, add `--platform` and it will FAIL:
  `FROM --platform=linux/amd64 node:16 as build`
  
  **Version (please complete the following information):**
  ```
  > checkov -v      
  2.3.240
  ```
  
  **Additional context**
  Add any other context about the problem here.
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `checkov/dockerfile/checks/AliasIsUnique.py`
  Content:
  ```
  1 from __future__ import annotations
  2 
  3 from typing import TYPE_CHECKING
  4 
  5 from checkov.common.models.enums import CheckCategories, CheckResult
  6 from checkov.dockerfile.base_dockerfile_check import BaseDockerfileCheck
  7 
  8 if TYPE_CHECKING:
  9     from dockerfile_parse.parser import _Instruction
  10 
  11 
  12 class AliasIsUnique(BaseDockerfileCheck):
  13     def __init__(self) -> None:
  14         """
  15         Ensure From Alias are unique for multistage builds.
  16         """
  17         name = "Ensure From Alias are unique for multistage builds."
  18         id = "CKV_DOCKER_11"
  19         supported_instructions = ("FROM",)
  20         categories = (CheckCategories.CONVENTION,)
  21         super().__init__(name=name, id=id, categories=categories, supported_instructions=supported_instructions)
  22 
  23     def scan_resource_conf(self, conf: list[_Instruction]) -> tuple[CheckResult, list[_Instruction] | None]:
  24         alias = []
  25         for instruction in conf:
  26             if " as " in instruction["value"]:
  27                 temp = instruction["value"].split()
  28                 alias += [temp[2]]
  29 
  30         if len(alias) == len(set(alias)):
  31             return CheckResult.PASSED, None
  32         else:
  33             return CheckResult.FAILED, [conf[0]]
  34 
  35 
  36 check = AliasIsUnique()
  37
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/checkov/dockerfile/checks/AliasIsUnique.py b/checkov/dockerfile/checks/AliasIsUnique.py
  --- a/checkov/dockerfile/checks/AliasIsUnique.py
  +++ b/checkov/dockerfile/checks/AliasIsUnique.py
  @@ -24,13 +24,12 @@
           alias = []
           for instruction in conf:
               if " as " in instruction["value"]:
  -                temp = instruction["value"].split()
  -                alias += [temp[2]]
  +                alias.append(instruction["value"].rsplit(maxsplit=1)[-1])
   
           if len(alias) == len(set(alias)):
               return CheckResult.PASSED, None
  -        else:
  -            return CheckResult.FAILED, [conf[0]]
  +
  +        return CheckResult.FAILED, [conf[0]]
   
   
   check = AliasIsUnique()
  
verification_info: {"golden_diff": "diff --git a/checkov/dockerfile/checks/AliasIsUnique.py b/checkov/dockerfile/checks/AliasIsUnique.py\n--- a/checkov/dockerfile/checks/AliasIsUnique.py\n+++ b/checkov/dockerfile/checks/AliasIsUnique.py\n@@ -24,13 +24,12 @@\n         alias = []\n         for instruction in conf:\n             if \" as \" in instruction[\"value\"]:\n-                temp = instruction[\"value\"].split()\n-                alias += [temp[2]]\n+                alias.append(instruction[\"value\"].rsplit(maxsplit=1)[-1])\n \n         if len(alias) == len(set(alias)):\n             return CheckResult.PASSED, None\n-        else:\n-            return CheckResult.FAILED, [conf[0]]\n+\n+        return CheckResult.FAILED, [conf[0]]\n \n \n check = AliasIsUnique()\n", "issue": "CKV_DOCKER_11 false positive when `--platform` is used\n**Describe the issue**\r\n\r\nCKV_DOCKER_11 false positive when `--platform` is used (possibly other arguments as well)\r\n\r\nFor reference: _\"CKV_DOCKER_11: \"Ensure From Alias are unique for multistage builds.\"_  In other words, make sure you add `as myAlias` at the end of your `FROM` line\r\n\r\n**Examples**\r\n\r\nThis will PASS as expected:\r\n`FROM node:16 as build`\r\n\r\nNow, add `--platform` and it will FAIL:\r\n`FROM --platform=linux/amd64 node:16 as build`\r\n\r\n**Version (please complete the following information):**\r\n```\r\n> checkov -v      \r\n2.3.240\r\n```\r\n\r\n**Additional context**\r\nAdd any other context about the problem here.\r\n\n", "before_files": [{"content": "from __future__ import annotations\n\nfrom typing import TYPE_CHECKING\n\nfrom checkov.common.models.enums import CheckCategories, CheckResult\nfrom checkov.dockerfile.base_dockerfile_check import BaseDockerfileCheck\n\nif TYPE_CHECKING:\n    from dockerfile_parse.parser import _Instruction\n\n\nclass AliasIsUnique(BaseDockerfileCheck):\n    def __init__(self) -> None:\n        \"\"\"\n        Ensure From Alias are unique for multistage builds.\n        \"\"\"\n        name = \"Ensure From Alias are unique for multistage builds.\"\n        id = \"CKV_DOCKER_11\"\n        supported_instructions = (\"FROM\",)\n        categories = (CheckCategories.CONVENTION,)\n        super().__init__(name=name, id=id, categories=categories, supported_instructions=supported_instructions)\n\n    def scan_resource_conf(self, conf: list[_Instruction]) -> tuple[CheckResult, list[_Instruction] | None]:\n        alias = []\n        for instruction in conf:\n            if \" as \" in instruction[\"value\"]:\n                temp = instruction[\"value\"].split()\n                alias += [temp[2]]\n\n        if len(alias) == len(set(alias)):\n            return CheckResult.PASSED, None\n        else:\n            return CheckResult.FAILED, [conf[0]]\n\n\ncheck = AliasIsUnique()\n", "path": "checkov/dockerfile/checks/AliasIsUnique.py"}], "after_files": [{"content": "from __future__ import annotations\n\nfrom typing import TYPE_CHECKING\n\nfrom checkov.common.models.enums import CheckCategories, CheckResult\nfrom checkov.dockerfile.base_dockerfile_check import BaseDockerfileCheck\n\nif TYPE_CHECKING:\n    from dockerfile_parse.parser import _Instruction\n\n\nclass AliasIsUnique(BaseDockerfileCheck):\n    def __init__(self) -> None:\n        \"\"\"\n        Ensure From Alias are unique for multistage builds.\n        \"\"\"\n        name = \"Ensure From Alias are unique for multistage builds.\"\n        id = \"CKV_DOCKER_11\"\n        supported_instructions = (\"FROM\",)\n        categories = (CheckCategories.CONVENTION,)\n        super().__init__(name=name, id=id, categories=categories, supported_instructions=supported_instructions)\n\n    def scan_resource_conf(self, conf: list[_Instruction]) -> tuple[CheckResult, list[_Instruction] | None]:\n        alias = []\n        for instruction in conf:\n            if \" as \" in instruction[\"value\"]:\n                alias.append(instruction[\"value\"].rsplit(maxsplit=1)[-1])\n\n        if len(alias) == len(set(alias)):\n            return CheckResult.PASSED, None\n\n        return CheckResult.FAILED, [conf[0]]\n\n\ncheck = AliasIsUnique()\n", "path": "checkov/dockerfile/checks/AliasIsUnique.py"}]}