Tag: python

docker compose – add python to LAMP

In linux I build a blog application that is based on mysql, apache2 and php. But I use some python for it. The python is for adapting python Pygments that is described there https://davidwalsh.name/pygments-php-wordpress . I prepared docker compose stage that works fine but python does not work in it. How to add python to […]

Cannot start rabbitmq-server in docker container, how to write this Dokcerfile?

Cannot start rabbitmq-server in my docker container Here is my Dockerfile # python official docker image, I have check that it is base on the debain jessie # The first line of python:2.7 Dockerfile is “FROM buildpack-deps:jessie” FROM python:2.7 # The rabbitmq-server install commands are as follow # I am sure that if I execute […]

Building image on a docker container for running own Django app

I’m trying to build an image for run in a Docker container with an own existing Django app doing the following command sudo docker build -t avilaholding/clubmercado ~/Documents/docker/cmimage but I get this error with psycopg2 instead Collecting pathspec==0.3.4 (from -r /srv/clubmercado/requirements.txt (line 23)) Downloading pathspec-0.3.4.tar.gz Collecting psycopg2==2.6.1 (from -r /srv/clubmercado/requirements.txt (line 24)) Downloading psycopg2-2.6.1.tar.gz (371kB) […]

How to install docker-compose on Linux RHEL 6.6?

Any idea how to install docker-compose on Linux RHEL. I followed below steps sudo yum install epel-release sudo yum install -y python-pip sudo pip install docker-compose sudo yum upgrade python* I am getting below message when trying to check its version (docker-compose -version) Traceback (most recent call last): File “/usr/bin/docker-compose”, line 7, in <module> from […]

Jupyter Spark database access; java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

I am using Python 2.7 & Spark 2.0.2 in a jupyter notebook trying to access a mySql database in another docker container. I have implemented just about everything I can find to remedy the issue and still coming up short. This is my model, so at least similar has been done before. I put my […]

Can one use python 3.5 in a docker container based out of the TensorFlow docker image?

I was trying to use python 3.5 with my docker container. I tried: gcr.io/tensorflow/tensorflow:latest-devel and gcr.io/tensorflow/tensorflow:latest-devel-py3 but it seems that both images only have python version up to 3.4. Is it possible to have as base image the docker container but also have python 3.5? Or even better, is it possible to have the base […]

Get the host name from within the docker container from Python program

As per my application requirement, I need to get the server IP and the server name from the python program. But my application is resides inside the specific docker container on top of the Ubuntu. I have tried like the below import os os.system(“hostname”) # to get the hostname os.system(“hostname -i”) # to get the […]

List containers in the same docker-compose

I am working on an application that takes advantage of docker-compose. One of the containers is a watchdog component, that runs a small python script periodically to get the states of the sibling containers, and takes action if one of the containers stopped. To this point I used a list of all container names that […]

Importing .so file made with Cython results in ImportError: … undefined symbol

I have cythonised a chunk of code, which I know works on my usual machine. However, when I transfer it and run it on another machine it is not working. My machine is running Ubuntu and the other machine is running Ubuntu within Docker. The error is: from myFile import myFunction ImportError: /myFile.so: undefined symbol: […]

Run shell script inside Docker container from another Docker container?

If I am on my host machine, I can kickoff a script inside a Docker container using: docker exec my_container bash myscript.sh However, let’s say I want to run myscript.sh inside my_container from another container bob. If I run the command above while I’m in the shell of bob, it doesn’t work (Docker isn’t even […]

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