Tag: python

How can a few small Python scripts be run periodically with Docker?

I currently have a handful of small Python scripts on my laptop that are set to run every 1-15 minutes, depending on the script in question. They perform various tasks for me like checking for new data on a certain API, manipulating it, and then posting it to another service, etc. I have a NAS/personal […]

DocumentDB in Docker – “The authorization token is not valid at the current time.”

I’m running a Python Tornado application in Docker, and part of the API involves connecting to DocumentDB for storage: client = document_client.DocumentClient(config.uri, {‘masterKey’: config.key}) db = next((data for data in client.ReadDatabases() if data[‘id’] == config.db)) coll = next((docs for docs in client.ReadCollections(db[‘_self’]) if docs[‘id’] == config.collection)) The authorization works perfectly and I’ve done many calls […]

Should I create a volume for project files when using Docker with git?

I want to Dockerize a project. I have my project files in a git repo. The project is written in python, and requires a virtual environment to be activated and a pip installation of requirements after the git clone from the repo. The container is going to be a development container, so I would need […]

Using docker with python packages

I am trying to use medpy on a Mac OSX. I tried running docker run loli/medpy but nothing seems to happen. And I cannot get pip to install itk on my Mac OSX. Pip install itk shows this error Collecting itk Could not find a version that satisfies the requirement itk (from versions: ) No […]

Docker error with pip version while building new image

I have an issue with the build of a new image using python on Docker (RHEL7). I used this code to create the image with a Dockerfile builder: docker build -t navitia-builder . And the following error appear: Command “/usr/bin/python -c “import setuptools, tokenize;__file__=’/tmp/pip-build-uSw6UQ/cffi/setup.py’;exec(compile(getattr(tokenize, ‘open’, open)(__file__).read().replace(‘\r\n’, ‘\n’), __file__, ‘exec’))” install –record /tmp/pip-FjGJow-record/install-record.txt –single-version-externally-managed –compile” failed […]

gunicorn with flask application not allowing more than one connection

I have an API written in flask that is getting requests from an iPad application. The application sends a series of requests to the API every minute. When this is happening, I can’t access the API from any other device until I close the app on the first device. Then after 30 seconds to a […]

'Graph' object has no attribute 'SerializeToString' on Windows Docker

I’m trying to run tutorials : https://www.tensorflow.org/versions/master/tutorials/mnist/tf/index.html I got below error message: root@db411995c219:~/pjh# python fully_connected_feed.py Extracting data/train-images-idx3-ubyte.gz Extracting data/train-labels-idx1-ubyte.gz Extracting data/t10k-images-idx3-ubyte.gz Extracting data/t10k-labels-idx1-ubyte.gz Traceback (most recent call last): File “fully_connected_feed.py”, line 231, in <module> tf.app.run() File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/default/_app.py”, line 30, in run sys.exit(main(sys.argv)) File “fully_connected_feed.py”, line 227, in main run_training() File “fully_connected_feed.py”, line 164, in run_training […]

How can I connect to a server using python sockets inside a Docker container?

I am new to Docker and I am trying to run my python program in a container. My program needs to connect to a server through a socket in order to work fine. I have created my program’s docker image and its respective container, but when it gets to the following line it fails, and […]

Host Global Python Object in Docker Container

I have an object in Python thats pretty big (~10gb). I want to host the object in a Docker container and expose some of its methods to other docker containers, which is possible through TCP. Most web application frameworks doesn’t guarantee a single main process where the object can live in peace. How should I […]

How to add a production config when deploying a docker container?

I used to deploy Python web applications on AWS EC2 instances with Ansible. In my development environment, I use config from a module local_config.py, but in the deployment process, I use an Ansible task to replace this file with a production-ready config. How do I do something similar when building a Docker image?

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