Do you need Docker if you have JARs?

I am currently playing a lot with Docker and I really like it, weird as it is for a seasoned sysadmin like me. Once you have solved the init PID1 problem (which is easily done with Alpine and Busybox’s init), then Docker is a convincing technology for many use cases.

But I still fail to really appreciate the need for it if all you use are single, fat, executable JARs.

I build all my application as single JARs. The only dependency I have is the JVM and really, it is not too difficult to keep it current accross all your machines, being metal, KVM or OpenVZ, especially with the help of puppet. So… what are the benefits of encapsulating an executable JAR into a Docker container?

If things are carefully designed using technologies like Spring Boot, your micro service fits altogether in one JAR and an appropriate should suffice to run the beast.

On the other hand, Docker is very well suited for some scenarios. For example if you use python 3 and all the host offers is a python 2 interpreter, if you have separate dependencies and so on.

But as far as JARs are concerned, I will stick to no Docker for the moment.

base64 images in HTML pages

I have found out that it is possible to embed images in a HTML page as base64 strings! I like the idea of having everything as text. I use it to display the favicon on the front page of my web site.

This is very easy:

Convert your favicon to base64:

$ base64 -w 0 favicon.ico

The -w switch is to have the whole string as a single line.

Include this entry in the <head> section of your HTML page:

<link href="data:image/x-icon;base64,AAABAAE...fAAD//wAA" rel="icon" type="image/x-icon" />

I cut the base64 string a little for better visibility.

Another cool use of base64.


Ulysse renonça à la vie éternelle, à la jeunesse éternelle et à la jouissance éternelle que lui offrait Calypso pour retrouver sa femme et son fils, son île, sa place dans le monde.

Au temps des Grecs, avant les religions révélées, les prophètes, les livres uniques, les promesses d’au-delà merveilleux, Ulysse était un héros.

Aujourd’hui, il serait un looser.

Bienvenue dans la postmodernité.

Debloat docker

I recently read about docker wanting to move all their official images from the likes of Debian/Ubuntu/CentOS to Alpine Linux. This is a fantastic idea!

Alpine is very small, it is similar to the busybox image, but it includes a package manager (apk, similar to apt-get and yum) and the distribution provides about 6,000 packages, including openjdk (a must for a Spring developer like me).

The micro images are very easy to use, we go back to the roots of Linux, before systemd, even before sysv 😉 Alpine is now my base image for everything except when I need to have glibc, that is to say when I need to run binaries compiled against it, and it would be too much hassle to recompile against musl (the libc used by Alpine).

Busybox HTTPD

I love busybox. It is super simple to compile, fully customizable. It even includes a web server! These are the steps I took to make it work, from source.

Make sure you have the following packages installed on your machine: git, gcc, make

Clone the repo:

$ git clone git://

Compile the source:

$ cd busybox
$ make defconfig
$ make

If you have multicore, you can speed up compilation by running (for example if you have 4 cores):

$ make -j 4

Once done, you have an executable called ‘busybox’. Run it and you will see all the commands included. You run a command as follows, for example to open a vi text editor:

$ ./busybox vi

Now, to run a web server, the command is called httpd. Each command has a short help, called with the –help switch. For httpd:

$ ./busybox httpd --help
BusyBox v1.25.0.git (2016-02-11 12:45:41 GMT) multi-call binary.

Usage: httpd [-ifv[v]] [-c CONFFILE] [-p [IP:]PORT] [-u USER[:GRP]] [-r REALM] [-h HOME]
or httpd -d/-e/-m STRING

Listen for incoming HTTP requests

        -i              Inetd mode
        -f              Don't daemonize
        -v[v]           Verbose
        -p [IP:]PORT    Bind to IP:PORT (default *:80)
        -u USER[:GRP]   Set uid/gid after binding to port
        -r REALM        Authentication Realm for Basic Authentication
        -h HOME         Home directory (default .)
        -c FILE         Configuration file (default {/etc,HOME}/httpd.conf)
        -m STRING       MD5 crypt STRING
        -e STRING       HTML encode STRING
        -d STRING       URL decode STRING

So, you can launch a web server for example like this:

$ ./busybox httpd -p 8000 -h /path/to/www/pages

There are many more possibilities, including setting up mime types, running CGI scripts etc. More information can be found on the OpenWrt wiki site where the configuration file is explained in details.

Lire de tout

La majeure partie de mon temps libre se passe à lire. J’aime beaucoup de choses : jouer aux échecs, faire du piano, me ballader à vélo, pratiquer le yoga… mais mon activité préférée reste la lecture.

La lecture de quoi ?

Eh bien de tout, justement. Je passe allègrement d’un Dickens à un Bob Morane, du Gai savoir au Club des cinq ou des Essais de Montaigne aux Histoires extraordinaires de Pierre Bellemare.

La diversité de la production littéraire me fascine. Il y a bien sûr des livres et des auteurs que je n’aime pas. Mais je ne pense pas qu’il y ait un genre que je n’aime pas dans son ensemble, à part peut-être ce que les anglo-saxons nomment la romance. Mais sinon, philosophie, histoire, romans, livres pour ados, récits… tout me convient !