This is not possible in core Magento 2, the container node only supports these attributes:
You would need to load a template inside that container and add your attribute there.
*Make sure your layout file is correct way, otherwise not works!
Please try below code
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<!-- Here I have tried both methods but no one ...