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?

Kindly support me via Bitcoin, Ko-fi, Trakteer, or just continue to read another content. Any kind of supports is greatly appreciated!