Created
February 3, 2015 22:42
-
-
Save dkoppel/b73dae72507f63a0ae18 to your computer and use it in GitHub Desktop.
talk on zmq/thingsbus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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