Tag: python

Cannot connect externally to a docker container running CherryPy server

I have a simple CherryPy server running on a Docker container, and I cannot access it externally. I run it using docker run -p 8181:8181 image-name. It starts up just fine and I see the normal server log. If I try a curl (curl localhost:8181) from inside the container, I get the “Hello World” response. […]

Why can “docker-compose run” create files outside the container?

I am new to Docker and I am learning Docker with its official docs. In one tutorial, it explains how to create a Django project with Docker. What I can not understand is the command below. docker-compose run web django-admin.py startproject composeexample . The doc says it will create a Django project inside a container, […]

python cannot import module

I have a problem. I want to use the docker-py(0.4.0) library, but i cannot import it. My code looks as followed: docker.py import docker c = docker.Client() c.info() then i get this error message: Traceback (most recent call last): File “./docker.py”, line 1, in <module> import docker File “/home/vagrant/docker.py”, line 3, in <module> c = […]

docker rabbitmq crashing during startup

Starting (docker run) the rabbitmq image results in a crash. The contents of startup_err: Crash dump was written to: erl_crash.dump init terminating in do_boot () startup_log BOOT FAILED =========== Error description: {error,{cannot_create_mnesia_dir,”/var/lib/rabbitmq/mnesia/rabbit@localhost/”, eacces}} Log files (may contain more information): /var/log/rabbitmq/rabbit@localhost.log /var/log/rabbitmq/rabbit@localhost-sasl.log Stack trace: [{rabbit_mnesia,ensure_mnesia_dir,0, [{file,”src/rabbit_mnesia.erl”},{line,472}]}, {rabbit_node_monitor,prepare_cluster_status_files,0, [{file,”src/rabbit_node_monitor.erl”},{line,99}]}, {rabbit,’-boot/0-fun-1-‘,0,[{file,”src/rabbit.erl”},{line,326}]}, {rabbit,start_it,1,[{file,”src/rabbit.erl”},{line,354}]}, {init,start_it,1,[]}, {init,start_em,1,[]}] {“init terminating in do_boot”,{rabbit,failure_during_boot,{error, […]

Problems connecting pycharm to remote interpreter via docker

I’m trying to connect pycharm 2016.2 professional to remote python interpreter via docker. I have docker for windows version 1.12.0-rc2-beta20 (the one that uses hyper-v on windows 10; not virtualbox). In pycharm, there’s dialog that asks for the docker API URL which is by default populated with: https://192.168.99.100:2376 But that doesn’t connect. I also tried […]

Django Server wont launch in Docker-Compose

I am attempting to port a Django project over to Docker-Compose for deployment purposes. I followed a variety of tutorials online and from my understanding, the only services my App requires are Django and Postgres. Here is my docker-compose.yml file: db: image: postgres:latest ports: – “5432” environment: POSTGRES_PASSWORD: postgres POSTGRES_USER: postgres web: build: . ports: […]

Docker Setup with a Mysql Container for a Python App

I have one container running “dockerfile/mysql” which I can connect to and interact with. I’m trying to build another image for a Python application that will read from a mysql db. The problem is that the Python app requires MySQL-python and attempts to install it on setup. Because this container does not hold the mysql […]

Fig Python 3 Compatible?

I have a django app running python 3.4 and I want to use Fig to help set up dockerized containers for my application’s components. When I run fig up I get the following error: Recreating app_db_1… Recreating app_search_1… Creating app_web_1… Traceback (most recent call last): File “/usr/local/Cellar/fig/1.0.1/libexec/bin/fig”, line 9, in <module> load_entry_point(‘fig==1.0.1’, ‘console_scripts’, ‘fig’)() File […]

docker-py: Accessing output of python script run in ENTRYPOINT command

I’m having trouble getting the output of a Python script I’m running in a docker container using the docker-py module in Python. First, some context: I’ve created a Dockerfile and built my image (with id 84730be6107f) in the normal way via the command line (docker build -t myimage /path/to/dockerfile). The Python script is executed as […]

Django can't connect to Postgres in Docker setup

I’m setting up an application in Docker that uses Django and Postgres. I’m unable to connect to Postgres from the app. When I run either: docker-compose run web python manage.py runserver docker-compose run web python manage.py migrate I get the following error: django.db.utils.OperationalError: could not connect to server: No such file or directory Is the […]

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