Tag: python

How do I configure a Flask app inside a Docker container to parse a large MessagePack object?

I’m getting the following when sending a very large POST to a Flask application. Logs: restful stderr | /usr/local/lib/python2.7/dist-packages/werkzeug/filesystem.py:63: BrokenFilesystemWarning: Detected a misconfigured UNIX filesystem: Will use UTF-8 as filesystem encoding instead of ‘ANSI_X3.4-1968’ BrokenFilesystemWarning) restful stderr | 172.19.0.5 – – [25/Apr/2017 00:05:40] “POST /ml/source/ HTTP/1.1” 500 – restful stderr | Traceback (most recent call […]

A better way to deploy a Debian-python hybrid application

I wrote a small application for Debian linux that calls python2.7 to perform almost all of its functions. The python functions include for example remote database access, so the app will depend on python modules that are not in every linux distribution by default. The app is packaged in a dpkg file in order to […]

Install pylint in Alpine Linux based Docker Image

I am trying to install Pylint in a custom Docker image which is based on the Alpine Linux distribution of the official Python image. I tried with the following Dockerfile: FROM python:3.4-alpine RUN apk add –update pylint << This fails with Step 2/2 : RUN apk add –update pylint —> Running in 34949003816d fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz […]

Pass parameter to Docker without -e flag

I’m trying to replicate someone else’s work as a learning experience. They seem to have created a Docker container that can take parameters on build without the -e flag. I’m new to Docker and I’ve been trying to figure out how this works. I’ve been playing around with my Dockerfile and it’s sitting at: 1 […]

Save data generated from a Python app running in Docker swarms in Mysql Database

I would like to run multiple instances of my Python app using Swarm in Docker, running on two raspberry Pi. The app communicates with a Mysql db. I would like to save all the data generated from the replicas in one common database but I cannot figure out what is the best way to do […]

PDAL: Couldn't create filter stage of type 'crop'

I’m trying to use pdal in python. I started with a super simple cropping: json = “””{ “pipeline”:[ “ARRA-LFTNE_NewYork_2010_000636.las”, { “type”:”crop”, “bounds”:”([616766.770,617765.46],[4510733.640,4511649.800])” }, “output.laz” ] }””” pipeline = pdal.Pipeline(unicode(json,encoding=”utf-8″)) pipeline.validate() # check if our JSON and options were good pipeline.loglevel = 8 #really noisy count = pipeline.execute() arrays = pipeline.arrays metadata = pipeline.metadata log = […]

how does docker handle file creation?

My code dumps mongo collections to a local folder then uploads to s3 bucket cmd = “mongoexport ” \ “–host ” + url + \ ” –port ” + str(port) + \ ” –username ” + user + \ ” –password ” + password + \ ” –db ” + db_name + \ ” –collection […]

Elastic Beanstalk Docker images failing to pull

I am upgrading one of our EB environments and using python:3.6.1-alpine as a new Docker image. The problem is Elastic Beanstalk is failing to find the docker image tag for 3.6.1-alpine Pulling repository docker.io/library/python Tag 3.6.1-alpine not found in repository docker.io/library/python. Check snapshot logs for detail Pulling the image locally does work however: (env)lappy:project dave$ […]

How to backup MongoDB in a setup with multiple Docker containers?

I have an application which is split into multiple Docker containers: Container 1 contains a MongoDB database Container 2 contains a python script which performs some operations on a daily basis and stores the results in the MongoDB of Container 1 using pymongo. Previously to using Docker, i.e., having the MongoDB and the python app […]

Passing custom field from flask to celery worker

Background I have to separate flask code and celery task code for the reason of dockerizing my services. To do that, I followed this sample. Problem I need to carry some information from flask app to celery worker. To do that, I can pass it as argument in celery.send_task() everytime, but it’s ugly. This information […]

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