I am using some curl command to get the IP of my host. The curl command is running fine in the terminal itself. Here is the curl command I used:
curl ${ECS_CONTAINER_METADATA_URI_V4} 2>/dev/null | jq -r '.Networks[0].IPv4Addresses[0]'
It returns the IP address of my host.
I have a Dockerfile like this:
FROM haproxy:alpine
ENV CONSUL_TEMPLATE_VERSION=0.24.1
RUN apk --update add wget
ENTRYPOINT ["consul-template","-config=/etc/consul-template/data/haproxy.hcl", "-consul-addr=xx.xx.xx.xx:8500"]
I need to pass the output of the curl to the 'xx.xx.xx.xx' in the ENTRYPOINT section of my Dockerfile. What can I try next?
I tried it passing like this, but it's not working:
-consul-addr=${curl ${ECS_CONTAINER_METADATA_URI_V4} 2>/dev/null | jq -r '.Networks[0].IPv4Addresses[0]'}:8500"