Dec-19-2017, 11:30 PM
I'm having a hard time figuring out what is happening with this code:
However, if I run this inside the same docker container but started by docker-compose, it does the following:
after I start docker-compose, it waits 6 seconds and then prints "Starting..."
It's the same container, but one is called directly from the terminal, and the other is called by docker-compose. Could somebody help me debug this process? The container is running ubuntu 16.04, python 3.5 I guess.
print("Starting...") import os, signal import json import zmq from time import sleep context = zmq.Context() context = zmq.Context() socket = context.socket(zmq.PUB) socket.bind("tcp://*:5563") def check_kill_process(pstring): for line in os.popen("ps ax | grep " + pstring + " | grep -v grep"): fields = line.split() pid = fields[0] os.kill(int(pid), signal.SIGKILL) sleep(6)If I run this in my docker container, it outputs "Starting..." immediately after I run the code, and then exists after 6 seconds.
However, if I run this inside the same docker container but started by docker-compose, it does the following:
after I start docker-compose, it waits 6 seconds and then prints "Starting..."
It's the same container, but one is called directly from the terminal, and the other is called by docker-compose. Could somebody help me debug this process? The container is running ubuntu 16.04, python 3.5 I guess.