Tag: python

Celery not finding a Python module in it's working directory

I’m running the following task with celery inside a docker container: from web import create_celery_app import importlib import os celery = create_celery_app() @celery.task() def exec_module(module, args={}): print(‘celery task running: %s’ % (module)) print(args) print(os.getcwd()) print(os.listdir()) module = importlib.import_module(‘vision_modules.example_module.example_module’) module.run() I get the following error when the task is run: celery_1 | [2016-09-11 16:16:40,361: INFO/MainProcess] Received […]

Docker, pylibmc, memcached

I’ve project that uses memcached. So when docker trying to “pip install pylibmc“, library can’t find libmemcached cause it’s not installed yet. How can I organise my docker-compose.yml, or maybe I have to do something with dockerfile? Now my docker-compose.yml looks like (I’ve deleted memcached container lines): version: ‘2’ services: app: build: . volumes: – […]

How to run python scripts and do CMD in Dockerfile for the docker container

I have an image with a custom Dockerfile. When I start the container, I want to run CMD [“npm, “start”] but right before that, I need to run three scripts. I’ve tried: 1)putting the python scripts followed by npm start in a .sh script, and running CMD [“script-location/script.sh”] 2) calling CMD [“script”, “npm”, “start”] none […]

Tensorflow docker container predictions won't work outside of container

I went through the Tensorflow for poets Tutorial and then classified my own images, this is all done in the TF docker container provided. The model has a validation accuracy in the mid to low 90’s. There is a separate file that makes predictions for new images(below). I copied the files ‘retrained_labels_corn.txt’ and ‘retrained_graph_corn.pd’ and […]

What to do in order to use SQL in docker container deployed in cloud?

Right now, I have a simple web server in Python, pacakaged in a docker container, Linux based. That container is deployed in a private openstack cloud and a volume is attached to the container, mounted. The web server is saving data in a json file on the volume. However, I would like to replace that […]

Python invoke Docker build command line only one layer is built

I’m using python subprocess popen to invoke docker build command as follow cmd = ‘cd ./docker-test && docker build -t test -f Dockerfile-test . | tee build.log’ docker_ps = subprocess.Popen(cmd, stdout=subprocess.PIPE,shell=True) Running the cmd alone in terminal succeeded in building a docker image. However, when using above python code, only the first command in Docker-test […]

Trouble connecting to MS SQL from Alpine Linux Docker

I have a Docker Image that’s built from this docker file. The docker image is with a Vagrant VM which is Ubuntu 14.04 and I’m running it all in OSX 10.11.6. The Microsoft SQL Server is in an aws-ec2 instance. Since my program is in Python, I have tried 2 python libraries for connecting to […]

Access docker image through web server

I am using a docker image and I can successfully access it and run it through a python script from my host machine. I am using sidomo for that purpose. The script works fine locally but doesn’t give any output when I run it on server. Even the docker images command doesn’t give correct output […]

ImportError when importing elasticsearch.helpers in Python

I am using a docker container with Ubuntu 16.04 Xenial with a Python 3.5.2 virtual environment. Every time I am trying to initialize the server uWSGI I am getting the following Python error: File “/env/lib/python3.5/site-packages/elasticsearch_dsl/__init__.py”, line 5, in <module> from .search import Search File “/env/lib/python3.5/site-packages/elasticsearch_dsl/search.py”, line 3, in <module> from elasticsearch.helpers import scan ImportError: No […]

Multiple Python Scripts in Docker

This is quite a basic question but I haven’t been able to get an answer from researching on Google, although I think its more due to my lack of understanding, than the answer not being out there. I am getting to grips with Docker and have a python Flask Admin script and a postgres db […]

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