Tag: python

Pass messages as file through docker-py

Is there a way to pass messages as a file through docker and execute it on the docker shell? For instance, if x = “print 12345”, can I pass the value of x as a python file and copy it into my container. Then use shell to run this python file?

Concurrency error while executing DocumentDB stored procedure on multiple Docker containers

I am currently building a python Tornado web application using Azure Storage to store images, and DocumentDB to store metadata on the images. Whenever an image is uploaded, it can use any 1 of 2 possible Docker containers running the Tornado Web App to execute the POST method asynchronously. The error I’m having is when […]

Python logging class in Docker: logs gone

For several years now I’ve used Python’s logging class in the same way: def get_module_logger(mod_name): “”” To use this, do logger = get_module_logger(__name__) “”” logger = logging.getLogger(mod_name) handler = logging.StreamHandler() formatter = logging.Formatter( ‘%(asctime)s [%(name)-12s] %(levelname)-8s %(message)s’) handler.setFormatter(formatter) logger.addHandler(handler) logger.setLevel(logging.DEBUG) return logger Then in some module, logger = get_module_logger(__name__) Now, I am running a Python […]

How can I execute my tests in Debug in PyCharm using a Docker Python Interpreter?

I configured PyCharm Python Interpreter as a remote Docker Python Interpreter: I do not have any problem to run my tests using this configuration. But when I try to run them in Debug, execution freeze to this waiting for connection… status: So my questions are: What am I doing bad? How can I execute my […]

Running Docker in PyCharm using Windows and virtualenv (Tensorflow)

I am trying to run Docker in my PyCharm project. My PyCharm project uses Python 2.7, whereas the system default Python is 3.4. I installed Docker through this tutorial. I start the Docker engine using in my virtual env of Python 2.7: docker run -it -p 8888:8888 gcr.io/tensorflow/tensorflow I can access it through my browser […]

docker + django : loop + break using forms

I am using django in a docker container. I have a page with two buttons: ‘Run’ and ‘Stop’. When someone presses ‘Run’ it should start an optimisation process, when you press ‘Stop’, it should stop. views.py def runGA(request): #read from database and initate form rundata = RunModel.objects.get(SID=sid) runform = RunForm(request.POST or None, instance = rundata) […]

How to run Python Scripts on Windows using Docker with Tensorflow

I’m new to machine learning and am trying to play around with the MNIST data set. However I am running Windows and getting TensorFlow to run has been a challenge. I don’t have much RAM, so I can’t run Linux in a Virtual Box. So I got Docker, and don’t know how to run a […]

docker-py getarchive destination folder

I am following the instructions given in this link for get_archive()link but instead of creating my container i was trying to use already running container in my case “docker-nginx” as an input string and also the destination folder where my content was residing in nginx server as ‘/usr/share/nginx/html’ and got my output for the stat […]

Httplib2 exception raised when calling Twilio from python

I’m trying to send an SMS message via Twilio from some Python code running in a Docker container. The container was built from an Ubuntu image with Python 2.7 and the latest twilio–python helper library. When calling the TwilioRestClient messages.create() function, I get the traceback below. Also, I have confirmed via curl that I can […]

Running R Models using rpy2 interface on Docker. I am facing issue related to opening the port

First, I ran R models in windows system using rpy2 python interface. It’s running fine. Then, I migrate it to linux environment using docker. Now I’m executing same code with Docker run command, facing “rpy2.rinterface.RRuntimeWarning:port 11752 cannot be opened “. Note: my application running four R models using rpy2. That means it’s create four robjects. […]

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