slack-docker icon indicating copy to clipboard operation
slack-docker copied to clipboard

Adding custom env values?

Open teodorescuserban opened this issue 10 years ago • 2 comments

Hello, Thank you for your awesome idea! It would be nice to have some variables passed on to the message (like for example docker host hostname). This would make us avoid putting a long and descriptive name to the container itself.

teodorescuserban avatar Feb 09 '15 10:02 teodorescuserban

Do you mean like below idea? For example, invoke with a custom env as follows:

docker run -d -e webhook=URL -e message.DockerHost=$HOSTNAME \
 -v /var/run/docker.sock:/var/run/docker.sock int128/slack-docker

and hostname of the docker host is shown in messages.

docker/container_name
Image: ...
IP Address: ...
Path: ...
Args: ...
Started at: ...
DockerHost: docker-host.local

int128 avatar Feb 10 '15 05:02 int128

Mmm. This could work too for docker hostname only What I would prefer to do is to extract more data from the event to display or from the container suffering the respective event rather than pushing static env var into the node container. Like for example, container name would be more important than the container hostname (which is the container id). Assuming you are using fig, you could further extract from the container name the project, not only the container name. Things is i have to knowledge on node.js so I was just thinking that your idea can be a bit extended to enable users of this container to display more infos without actually change the node app.

teodorescuserban avatar Feb 10 '15 14:02 teodorescuserban