A Dockerized Slackbot running Hubot v3
A Slackbot token pre-configured for your team is required. Checkout the Slack docs for more information.
If you do not want to connect to the container and just want to run it, use daemon mode with -d:
(sudo) docker run -d -e HUBOT_SLACK_TOKEN=<token> --name sonny bsord/sonny
- To download, launch and connect to the container:
(sudo) docker run -it --name sonny bsord/sonny '/bin/bash'
- Finally, launch the bot within the container:
HUBOT_SLACK_TOKEN=<token> ./bin/hubot
The output of hubot startup and any console.log() within your scripts is directed to container logs and can be viewed within Docker.
(sudo) docker logs <container name>
- To stop the container:
(sudo) docker stop sonny
- To remove the container:
(sudo) docker rm sonny
- To list containers:
(sudo) docker ps -a
- To list images:
(sudo) docker images
- To remove the old image:
(sudo) docker rmi bsord/sonnyi
Additional ENV variables can be passed when starting Docker with the -e flag and then accessed within scripts as process.env.ENV_VARIABLE_NAME
-e ENV_VARIABLE_NAME='My Variable'
Directories within the Docker container can be exposed to the local machine with the -v flag.
-v /usr/src/hubot:/hubot (<docker path>:<local machine path>)
Docker ports can be exposed to extend functionality, such as with webhooks, using the -p flag.
-p 8080:8080 (<External Port>:<Internal Docker Port>)