[Unit]
Description=Export Docker container env vars for systemd services
DefaultDependencies=no
Before=basic.target ipa-first-boot.service ansipa-smb.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/bash -c "tr '\\0' '\\n' < /proc/1/environ | grep -E '^(IPA|SMB|LUKS|KEYCLOAK)_' > /etc/container.env; chmod 600 /etc/container.env"

[Install]
WantedBy=sysinit.target
