Skip to content

Instantly share code, notes, and snippets.

@dkoppel
Created February 3, 2015 22:42
Show Gist options
  • Save dkoppel/b73dae72507f63a0ae18 to your computer and use it in GitHub Desktop.
Save dkoppel/b73dae72507f63a0ae18 to your computer and use it in GitHub Desktop.
talk on zmq/thingsbus
# Pull base image.
FROM dockerfile/python
# Install Python requirements
RUN \
apt-get update && \
apt-get install -y libzmq-dev && \
pip install pyzmq
COPY zmqtalk.py /data/
RUN chmod 755 /data/zmqtalk.py
# Define working directory.
WORKDIR /data
# Define default command.
CMD ["/usr/bin/python","/data/zmqtalk.py"]
#!/usr/bin/env python2
import zmq
import sys
msg = "<zmqtalk> "
sys.argv.pop(0)
for x in sys.argv:
msg += x + " "
context = zmq.Context()
socket = context.socket(zmq.PUSH)
socket.connect('tcp://sally.ad.pumpingstationone.org:5558')
socket.send_string(msg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment