Elastic Agent show `Error dialing x509: certificate signed by unknown authority` but it is healthy in fleet

After i read relative answer then add fingerprint to Elasticsearch CA trusted fingerprint (optional) and ssl.certificate_authorities: ["/usr/share/elastic-agent/certs/ca/ca.crt"] to Advanced YAML configuration. Agent and Fleet run successfully, but i still want to ask if i can set those arguments before docker compose build up?