Tag: python

docker boto3 AWS was not able to validate the provided access credentials

I’m working in a Command line tool using boto3 in a container running python:3.4 image, In my laptop I can run the code without problem but inside the container I receive the following error: File “/usr/local/lib/python3.4/site-packages/botocore-1.3.26-py3.4.egg/botocore/client.py”, line 310, in _api_call return self._make_api_call(operation_name, kwargs) File “/usr/local/lib/python3.4/site-packages/botocore-1.3.26-py3.4.egg/botocore/client.py”, line 407, in _make_api_call raise ClientError(parsed_response, operation_name) botocore.exceptions.ClientError: An error […]

Error adding local file to docker image with docker-py

I have been working with docker-py, in order to build images and launch containers all in one script. So far it has been very smooth. However, I am currently having issues with the ADD/COPY commands in the Dockerfile string variable. I need to add a file from the source directory directly into the image. With […]

Django on App Engine Managed VM

I have a minimal Django project that I am trying to deploy onto Google App Engine Managed VMs. I’m having a bit of trouble understanding exactly what is going on and what is serving what. I have an app.yaml file that looks like this: runtime: custom vm: true entrypoint: custom api_version: 1 manual_scaling: instances: 1 […]

python variable not being passed?

Hi so I’m trying to write a script that at its most basic will list out running processes on a docker container using the docker_py api. I have the following: #!/usr/bin/python import docker import sys import argparse parser = argparse.Argument.Parser(description=’docker process checker’) parser.add_argument(‘-n’, help=’Name of container’, required=True) parser.add_argument(‘-p’, help=’Name of process’, required=True) args = parser.parse_args() […]

Flask-Babel won't translate text on AWS within a docker container, but does locally

I have a flask app that is using flask-babel to translate text. I have created a docker container for it all to run in. And i have verified multiple times that both are being run and built exactly the same way. When i put the app on my local docker container (using a vagrant linux […]

Issue running python scripts in docker container outside of run -it /bin/bash

So I have a weird issue with a python script I’m trying to run… this works: docker run -it <my image> /bin/bash <inside container> xvfb-run python myscript.py <arg> Everything starts up, firefox launches in headless mode, it’s all good. This doesn’t work: docker run -d <my image> /bin/bash -c “xvfb-run python myscript.py <arg>” docker top […]

Unable to access my web2py app login page by running docker container using gae

I am new to docker, I’m trying to run my web2py app using docker container in gae, my Dockerfile create the docker image, below is my dockerfile FROM ubuntu:trusty MAINTAINER john #install python RUN apt-get install -y -qq wget python unzip #install GAE RUN wget https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.zip && unzip google-cloud-sdk.zip && rm google-cloud-sdk.zip RUN google-cloud-sdk/install.sh –usage-reporting=true […]

Docker containers performance difference between OSX and Linux

I recently switched from OSX (el capitan) to Ubuntu (16.04) and I’m working on a Python project which makes use of docker containers for integration tests with different databases (I have containers for mysql, postgres and so on). What shocked me is that I noticed that my test suite runs about 4 times slower than […]

Unable to execute Postgresql commands with python in seperate docker containers

I have this setup 1) Docker Container Server running postgresql image in background created with command docker run –name post2 -d postgres 2) Client Docker Container running ubuntu with python running psycopg2 My Postgresql container is exposed on ip address 172.7.0.2:5432. I’m able to communicate with the server when enter command curl 172.17.0.2:5432 in my […]

Docker / congifparser error in requirements.txt

In my code I’m using configparser: from configparser import ConfigParser And I’m using pip freeze to generate my requirements.txt pip freeze > requirements.txt And for configparser it’s writing configparser==3.3.0.post2 But that fails when I do a pip install -r requirements.txt from within the docker container via a docker build: docker build -t denzel . Downloading/unpacking […]

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