Tag: python

Why is PyCharm killing my subprocess.Popen?

I have a very basic subprocess.Popen command like: cmd = [‘docker’, ‘run’, ‘–name=test’,’server’] p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) When I run this in a Python script from terminal, this correctly launches the docker image and the image is persisted until I docker stop it. However, when I run the same code from PyCharm 5, the […]

Two containers – two Pythons – one site-packages?

Let’s assume I have two separate docker (or some other) containers which may only share folders with each other. There is a Python interpreter of the same version installed in both of these containers. Is there any way to make these interpreters to share almost the same PYTHONPATH, e.g. for both of them see all […]

docker: cannot map two container ports to one host port

app.json for pm2 (src/app.py is Flask app): { “apps”: [ { “exec_mode”: “fork”, “script”: “src/app.py”, “args”: [“-p”, “8080”] }, { “exec_mode”: “fork”, “script”: “src/app.py”, “args”: [“-p”, “8081”] } ] } ~ Dockerfile: EXPOSE 8080 8081 CMD [“pm2”, “start”, “app.json”] Error when running docker: docker run -p 8080:8080 -p 8080:8081 oct20 docker: Error response from daemon: […]

how is docker better if tools like fedora's devassistant and virtualenv exist? [closed]

I am trying to understand docker.io LXC container for a while,but if we consider fedora‘s devassistant tool and virtualenv then virtualenv will do the work of isolation and devassistant will download all the needed dependency by interpreting the setup configuration file.so its like by using two keyword commands on terminal like we almost setup a […]

Docker vs old approach (supervisor, git, your project)

I’m on Docker for past weeks and I can say I love it and I get the idea. But what I can’t figure out is how can I “transfer” my current set-up on Docker solution. I guess I’m not the only one and here is what I mean. I’m Python guys, more specifically Django. So […]

Kafka not interacting with kaka-python code in docker

So I started a kafka and zookeeper instance on the host. Now I want to interact with it via two dockers – producer and consumer The code in the PRODUCER docker is: from kafka import KafkaProducer import time producer = KafkaProducer(bootstrap_servers=[‘localhost:9092’]) i = 0 while 1: # “kafkaesque” is the name of our topic producer.send(“stupid”, […]

Unable to preserve setup.py install state in docker container

I have a few scripts in docker for which I should install and run rabbitmq-server run a python script to setup exchanges and queues setuprabbit.py python setup.py install and run a few scripts of my own myscript.py myscript2.py myscript3.py I am trying to use docker now to automate the deployment. My dockerfile FROM phusion/baseimage:0.9.15 MAINTAINER […]

Running Disco in a Docker container

I need to run a run a Python script in a Docker container (I currently have execution of “disco_test.py” as my ENTRYPOINT command) that will utilize Disco (which of course needs to be running in that container). The problem is I cannot seem to get Disco running either with CMD or RUN in the Dockerfile, […]

Micro-components architecture with python / Django / Drf

I have several applications in my Django project: – ticker – payments – crypto – referrals – core I am using Docker wrapped by Wercker (quite limiting I would say, but saves time). My question is, how to deploy each application as a standalone container as a start, and a standalone VPS Node in the […]

Mysql python connector is unavailable when running pip install –allow external

While using Python 3.4 in a docker container, I have been using pip install mysql-connector-python –allow-external mysql-connector-python to install the dependency on new containers. Suddenly, however, the command fails saying “Could not find any downloads that satisfy the requirement”. I checked pypi and the dependency is still there, but for some reason pip can’t find […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.