Passing Hostname to Docker Services

tech · Apr 29, 2021 · ~1 min

Passing hostname to docker container won’t work

1
2
environment:
  - "HOST_HOSTNAME=$HOSTNAME"

Do this instead

1
2
environment:
  - "HOST_HOSTNAME={{ .Node.Hostname }}"

It will fetch the hostname from docker placeholder

Reference

Thank you for reading!

· · ·

Love This Content?

Any kind of supports is greatly appreciated! Kindly support me via Bitcoin, Ko-fi, Trakteer, or just continue to read another content. You can write a response via Webmention and let me know the URL via Telegraph.