Tag: python

docker-compose gives error “ImportError: No module named ssl_match_hostname” when run as normal user

I’ve installed docker-compose with ‘pip2.7 install docker-compose” but when I try to run it as ‘normal’ user I get the following error message: mike@hugin:~/Tobedeleted$ docker-compose -v Traceback (most recent call last): File “/usr/local/bin/docker-compose”, line 7, in <module> from compose.cli.main import main File “/usr/local/lib/python2.7/dist-packages/compose/cli/main.py”, line 17, in <module> from . import errors File “/usr/local/lib/python2.7/dist-packages/compose/cli/errors.py”, line 10, […]

Dockerized Django On Ubuntu

I am using: Ubuntu 16.04. Docker version 1.12.6. I want to containerize my existing Django app., knowing that everything goes well in this app. => no bugs, no errors… My Dockerfile: FROM django ADD . /BackendServer WORKDIR /BackendServer RUN pip install -r requirements.txt CMD [ “python”, “BackendServer/manage.py runserver 0.0.0.0:8000” ] requirements.txt djangorestframework gunicorn Now everything […]

creating copies of docker on multiple ports

what i am trying to do – run airflow in docker with celery my issue – my celery workers are in containers and i dont know how to scale them my docker-comopose file: version: ‘2’ services: mysql: image: mysql:latest restart: always ports: – “3306:3306” environment: – MYSQL_RANDOM_ROOT_PASSWORD=true – MYSQL_USER=airflow – MYSQL_PASSWORD=airflow – MYSQL_DATABASE=airflow volumes: – […]

Get the same output of the nproc command in Python

When using cgroups to limit the number of available CPUs, such as using the –cpuset-cpus flag in Docker, the nproc command prints the number of available CPUs while taking that limit into account. Python’s multiprocessing.cpu_count() prints the number of CPUs in the host regardless the cgroup limitation. Which function of Python should be called on […]

supervisor.sock refused connection in docker container

supervisor.sock refused connection in docker container I have tried to fix it by supervisorctl unix:///var/run/supervisor.sock refused connection AND Overlayfs does not work with unix domain sockets However, it still does not work in my debain server. Here is my docker_supervisor.conf FROM python:2.7 RUN pip install supervisor RUN mkdir /app WORKDIR /app COPY docker_supervisor.conf /app RUN […]

Can't build Dockerfile -: Not a directory Error using ADD command

I am trying to make a dockerfile for a python/flask webapp and keep running into issues inspite of multiple changes based off what I’ve read The Dockerfile I have at present is as follows: FROM ubuntu:latest #Update OS RUN sed -i ‘s/# \(.*multiverse$\)/\1/g’ /etc/apt/sources.list RUN apt-get update RUN apt-get -y upgrade # Install Python RUN […]

How can I install pdal in python in a dockerfile?

I have my own dockerfile, which creates an image with python with gdal and several other packages: FROM geodata/gdal:2.1.2 USER root RUN apt-get update && apt-get install -y \ build-essential \ gfortran \ libatlas-base-dev \ python-pip \ python-dev \ libxft-dev libfreetype6 libfreetype6-dev RUN apt-get install -y python-tk RUN pip install \ numpy \ matplotlib \ […]

Isolated and Reproducible Development Environment (X Forwarding + Docker)

Is there a way to run: Interactive Python (direct python/ipython, not Jupyter notebook with a remote connection) Matplotlib Display graphs within a Docker container, while displaying graphics on the host using X Forwarding (or any other alternative)? For example, I would like to be able to interactively run the following code on the container (line […]

Dockerpy test container timing out before database available?

I’ve got a database (Neo4J) loading in a Docker container, but I think my unit test hits the container before the database is loaded. def setUp(self): client = docker.from_env() self.container = client.containers.run(“neo4j”, detach=True, environment={‘NEO4J_AUTH’:’none’}, ports={7474:7474, 7687:7687}, volumes={‘/Users/myuser/neo4j/data’: {‘bind’: ‘/data’, ‘mode’: ‘rw’}} ) self.container.start() def test_database_loads(self): r = requests.get(self.database_url) self.assertEqual(r.status_code, 400) I get this error: ====================================================================== […]

Flask application on Docker with Let's Encrypt

I want to create a Flask application in a Docker instance that has HTTPS enabled using the Let’s Encrypt method of obtaining an SSL Cert. The cert also needs to be auto-renewed every so often (3 months I think), which is already done on my server but the Flask app needs to get access to […]

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