hubot: Add a hubot image
I had to instal Git to avoid a:
GET https://registry.npmjs.org/scoped-http-client
GET https://registry.npmjs.org/async
ERR! not found: git
npm ERR!
ERR! Failed using git.
This is most likely not a problem with npm itself.
Please check if you have git installed and in your PATH.
Linux 3.13.0
command "/usr/bin/node" "/usr/bin/npm" "install"
cwd /hubot
node -v v0.10.21
1.3.11
ENOGIT
error during the 'npm install'. Other than that, this is fairly
straightforward, although I wish that the script dependencies were
handled automatically :p.
Docker doesn't let you modify /etc/hosts at the moment [1]. If you
need to add custom DNS (because your target IRC server doesn't resolve
automatically), you can use dnsmasq [2]. I added something like this
to the tail of my hubot/Dockerfile.template:
RUN emerge -v dnsmasq
RUN rc-update add dnsmasq default
RUN echo 'address="/irc.example.net/192.168.0.2"' >> /etc/dnsmasq.conf
RUN echo 'nameserver 192.168.0.1' >> /etc/resolv.dnsmasq.conf
RUN echo 'resolv-file=/etc/resolv.dnsmasq.conf' >> /etc/dnsmasq.conf
RUN echo 'listen-address=127.0.0.1' >> /etc/dnsmasq.conf
RUN sed -i 's/need localmount net$/use localmount net/' /etc/init.d/dnsmasq
And fired up the container with:
docker run ... --dns 127.0.0.1 wking/hubot /bin/bash
# rc default
# cd hubot
# REDISCLOUD_URL="${REDIS_PORT}" exec bin/hubot --name "${HUBOT_IRC_NICK:-hubot}" -a irc
[1]: https://github.com/dotcloud/docker/issues/2267
[2]: https://github.com/dotcloud/docker/issues/1951#issuecomment-
24960347