Fixed
This commit is contained in:
parent
2a5179cf74
commit
7386ea1274
@ -1,7 +1,6 @@
|
||||
FROM prom/node-exporter:latest
|
||||
|
||||
USER root
|
||||
COPY entrypoint.sh /etc/node-exporter/
|
||||
RUN chmod +x /etc/node-exporter/entrypoint.sh
|
||||
|
||||
ENTRYPOINT [ "/etc/node-exporter/docker-entrypoint.sh" ]
|
||||
CMD [ "/bin/node_exporter" ]
|
||||
ENTRYPOINT ["sh", "/etc/node-exporter/entrypoint.sh"]
|
||||
CMD ["/bin/node_exporter"]
|
||||
|
@ -4,7 +4,7 @@ This is a copy of [prom/node-exporter](https://hub.docker.com/r/prom/node-export
|
||||
|
||||
## Example
|
||||
|
||||
For the hostname to be detected, you must load the host filesystem into the container's `/host` directory as seen here.
|
||||
For the hostname to be detected, you must mount the host's `rootfs` into the container's `/host` directory as seen here:
|
||||
|
||||
```
|
||||
version: '3.8'
|
||||
@ -21,5 +21,3 @@ services:
|
||||
deploy:
|
||||
mode: global
|
||||
```
|
||||
|
||||
Otherwise use the `$HOSTNAME` variable to specify the path to the *hostname file* & ensure it's mounted.
|
||||
|
@ -1,8 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -z "$HOSTNAME" ]; then $HOSTNAME="/host/hostname"; fi
|
||||
|
||||
NODE_NAME=$(cat "$HOSTNAME")
|
||||
NODE_NAME=$(cat "/host/etc/hostname")
|
||||
echo "node_meta{node_name=\"$NODE_NAME\"} 1" > /etc/node-exporter/node-meta.prom
|
||||
set -- /bin/node_exporter "$@"
|
||||
exec "$@"
|
||||
|
Loading…
Reference in New Issue
Block a user