Docker compoose entrypoint and specify interpolation of a curl command

Im using curl -s v4.ident.me to fetch my public IP address, and I need to use it as an option in the entrypoint.

Ive tried these different ways:
--nat $(curl -s v4.ident.me)
--nat ${curl -s v4.ident.me}
--nat ${{curl -s v4.ident.me}}

Whats the trick here? The Compose documentation seemed to indicate that that middle one would be the one to use for setting variables to a container, but none of those are working.

Am I missing something?

Do you expect compose to execute your curl command? That wonā€™t happen.

1 Like

I seeā€¦ Im converting a set of systemctl services over to Compose, and I guess I just assumed Compose would do it as well as the .service file can do so. Ill have to come up with something then thanks much for this reply.