Laur IVAN

Monitor Docker Logs with ELK – 1

Posted by in IT, Tutorial

Following my attempts to monitor ethOS data via ElasticSearch and Kibana, I’ve thought it would be a good idea to start monitoring the logs produced by my various docker instances. This first part deals with configuring ELK and logspout. Prerequisites I assume the following: ELK is installed. You can do it either as a set of Docker images (oh, the meta!) or just plain package install. The receiver machine is configured. E.g., if you’re on windows, create a firewall rule opening TCP port 35000 (corresponding to the config). Once this…read more

Docker Exec Path-based Commands

Posted by in IT, Tutorial

TL;DR: Use sh -c “command with arguments” I’ve tried to execute

in order to see the size used by a container’s logs. Unfortunately, this resulted in an error along the lines: du: C:/Program Files/Git: No such file or directory This means that my git bash prompt interpreted the / itself. In order to get around this limitation, you need to run:

HTH, A little experiment: If you find this post and ad below useful, please check the ad out :-)

Fix *standard_init_linux.go:XXX: exec user process caused “no such file or directory”* Error

Posted by in IT, Tutorial

TL;DR: Use dos2unix While switching from Ubuntu to Alpine images, I’ve encountered the fillowing error: standard_init_linux.go:195: exec user process caused “no such file or directory” Quite unfortunate, because the script stayed in the same spot and only the image changed. After reading a bunch, I figured that it’s the fact that I’m editing on Windows and Alpine doesn’t seem to interpret #/bin/sh properly – adding a ^M :). The solution is to either fix the script locally or to format it as part of the docker build process. I chose…read more

HTTP 400 Bad Request with docker-maven-plugin

Posted by in IT

TL;DR: Check your Dockerfile (try to build it manually) before anything else! Today I was struggling with a 400 error: Exception caught: Request error: POST https://192.168.99.101:2376/build?t=localhost:5000/eris-django:2.0.1-ivanlla: 400: HTTP 400 Bad Request -> [Help 1] when building an image with the docker-maven-plugin. After installing and uninstalling docker, cleaning up certificates etc, I figured out my setup had nothing to do with it. Instead, there was a configuration error or the docker file. More specific, I was using alpine and I forgot the RUN prefix to a command. I’ve tried to dun…read more

Initialise Python with GoCD

Posted by in IT, Tutorial

Following the deployment of a python-aware agent, we can start creating a pipeline. The first stage would be to: Clean up any previous data Create a virtual environment for python Install all dependencies from a requirements.txt file in our project Note: we assume the global pipeline settings and the Materials are properly set up (e.g. out project will be checked out in ./project). Since the above operations must be executed in order, I’ve set up a Setup stage with a job named virtualenv. The job has three tasks: rm virtualenv…read more

Create a Python-friendly GoCD Agent in Docker

Posted by in IT, Tutorial

I’ve got two requirements to make GoCD useful: Run both the server and agent(s) in Docker Make it python-friendly Fortunately, GoCD offers Docker images (and Dockerfiles) for both, so it’s just a matter of extending it:

Unfortunately, pip is not quite adequate, so we re-install it from source. In the Dockerfile we add:

Now we have a fully functional Docker file capable of building python applications and we can actually build the image. In the directory where we have the Dockerfile, execute:

Then, you can run it…read more

Allow Docker Container Access Behind Proxy

Posted by in IT, Tutorial

In the previous post, I’ve described how to build an image when you’re behind a proxy. Now, if your container needs access to the internet for e.g. downloading python dependencies, you’ll need to give it explicitly. The way to do it is via -e parameter (environment) of docker run. You can either make it verbose, or you can build an alias:

Then, you can just execute:

HTH, A little experiment: If you find this post and ad below useful, please check the ad out :-)

Use Docker Behind Proxy on Windows 8

Posted by in Software, Tutorial

The other day I had to install Docker at work, aka behind a corporate proxy (on Windows 8). While the docker installer is stand-alone and all is good, dealing with the VM is a different matter… The problem popped up when I tried to create a Django image and pip install failed miserably. To get around, you need to create a docker machine:

You also need to pass in the proxy as a build argument to build:

You can also pass the build argument to docker-compose but, in…read more

Gitlab Dreamhost SMTP

Posted by in IT, Tutorial

The other day I’ve tried to install GitLab on Docker because I’ve got a Synology NAS which does support Docker :) I’ve found that if I create an user, it sends a confirmation email (of course it does!) and, unlike with Django, I’m not that versed in RoR to reconfigure to use logs instead of real SMTP. My SMTP of choice is Dreamhost and, since it’s not listed I had to do some digging. Without further ado, here’s the docker command I used:

where: [GITLAB.WEB.NAME] is the host name…read more