Use /etc/host_hostname
@alfeng6 is already working on this.
Since Jul 7, 2020.
- Dominant language
- Go
- Stars
- 16
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Description
The upstream logspout project supports reading `/etc/host_hostname` to determine the hostname. This allows one to expose the actual hosts name to the container rather than using the container id.
Currently, this does not work for logdna's logspout as the `HOSTNAME` environment variable appears to be the only way to set the hostname.
I am currently working around this as follows:
docker run -d \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /etc/hostname:/etc/host_hostname:ro \
-e LOGDNA_KEY= \
--entrypoint /bin/sh \
logdna/logspout:latest \
-c "HOSTNAME=\`cat /etc/host_hostname\` /bin/logspout"
I'm starting this container as part of an image baking process, so I cannot set the hostname to the value at the time the container is created as it will change.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.