How to update Docker CLI client for Windows

Sometimes you need to update your Docker Client for Windows, which was installed with Docker Toolbox. But you can’t find an easy way to do that (see this thread for example).

Docker Toolbox is the legacy way to use Docker on Windows, using VirtualBox, but it’s still useful when :

Upgrading the Docker Engine (server side) is easy with docker-machine. Just use :

docker-machine upgrade <machine_name>

and it will try to download the latest release (boot2docker.iso, working on VirtualBox) on .

To update Docker Client, you could reinstall Docker Toolbox, but it’s quite cumbersome. In fact you can rebuild docker.exe from sources. After Docker Toolbox installation, this file can normally be found in « C:\Program Files\Docker Toolbox\docker.exe« .

How to build an exe for Windows

I found in Docker Toolbox sources how docker.exe was built and embedded.
It’s partly in this line :

RUN cp /go/src/ docker.exe

Then I found that the CLI tool is in this repo :, under components/cli . So we can follow the instructions to build it.

For example, if you want to build docker.exe for a given version, let’s say « 18.05.0-ce », you can follow this script :

Install the new exe

Then you can backup your old docker.exe in « C:\Program Files\Docker Toolbox\docker.exe » and replace it with the new one.

Test the new version

Check that the new version is working :

> docker --version
Docker version 18.05.0-ce, build

Docker : my container was OOMKilled


Un container Docker dispose de ressources limitées à sa création (cpu, mémoire…). Il se peut que le container crashe subitement s’il dispose de ressources insuffisantes. Dans le cas d’un manque de mémoire, on aura donc une erreur du type OOMKilled.

Vérification de l’état du container

Toutes les informations sur l’état du container :

docker inspect --format="{{json .State}}" $INSTANCE_ID

Retourne par exemple :


Flag OOMKilled :

docker inspect --format='{{.State.OOMKilled}}' $INSTANCE_ID

Retourne true si OOM

Flag ExitCode :

docker inspect --format='{{.State.ExitCode}}' $INSTANCE_ID

Retourne 137 en cas de crash dû à OOM.
137 = (128+9) Container received a SIGKILL

Tracer le problème dans une JVM

Au sein d’une JVM, on peut essayer de tracer l’erreur.

Voir par exemple les paramètres :

java -XX:+PrintFlagsFinal -version | grep -i outofmemoryerror

bool CrashOnOutOfMemoryError = false {product}
bool ExitOnOutOfMemoryError = false {product}
bool HeapDumpOnOutOfMemoryError = false {manageable}
ccstrlist OnOutOfMemoryError = {product}

Une version de JVM container-friendly

Des paramètres ont été rajoutés dans les versions récentes de la JVM, pour essayer d’adapter les paramètres mémoire de la JVM (Xms, Xmx) avec ceux du container dans lequel elle s’exécute.

A partir de JDK 8u131+ et JDK 9 on trouve donc de nouveaux paramètres, notamment pour la mémoire :

-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap

Tickets concernés


Configure Git to use with a proxy and switching back


Sometimes it can be useful and even necessary to configure Git to use a proxy in the global configuration.
It’s a easy as ( :
git config --global http.proxy host:port

This configuration will then be written in ~/.gitconfig.

You will then have something like that :

	name = Me
	email =
	proxy = host:port

Then one day you want to switch and use a different proxy, or none.

But it’s not obvious to configure, regarding the official documentation (

I could simply unset the proxy if I want to use none, like this :
git config --global --unset http.proxy

I also tried to create aliases to switch to another configuration, like :

  1. git config --global alias.proxy-local 'config --local http.proxy host:port'
  2. git config --global alias.noproxy-local 'config --local http.proxy none'

So I can use ‘git proxy-local’ or ‘git noproxy-local’ depending of the project.

But it could be more practical. By searching further I found a way to configure the proxy depending on the URL. Within the configuration we can use this format to configure options : http.<url>.* (
Some examples are also documented like this :

[http ""]
	sslVerify = false
	cookieFile = /tmp/cookie.txt

So that way you can configure a proxy by default, and for some URL use another proxy or none :

; Use a proxy by default
	proxy = host:port
; Use no proxy on internal server
[http "http://myserver.mycompany/"]
	proxy = 

That’s it !

Generating a link to your issue tracker with IntelliJ

Sometimes it’s a good practice to post a commit message to your VCS (version control system), including a pattern with the issue number.

For example, you could commit changes towards Git or Subversion, with this commit message : « I fixed this nasty bug : #123 ».

And it could be nice to automatically generate a link to your issue tracker directly inside your favorite Java IDE.

Here’s how to do with IntelliJ IDEA :

  • Go to File > Settings > Version Control > Issue Navigation
  • Then add an item : here you have to fill in the issue ID (regex), and the issue link that will be generated (regex with replacement of the capturing group)

The dialog box you’ll get looks like this :


If you want to capture just a part of the regex, you can use the capturing groups.
Let’s say the pattern you use is « #issue-number », but you want to exclude the « # » from the URL generated. So in this case you will use a regex with one non-capturing group, and a capturing group.
So the issue ID regex will be : (?:#)([0-9]+)
And the issue link will be : http://my-issue-tracker/$1

That way, you’ll be able so see a clickable link in the Version Control window (ALT+9).

See also :

JMX MBean provided with Oracle JDBC Driver

I discovered that Oracle added a JMX MBean in Oracle JDBC Driver.
It’s called « Diagnosability Management ».

Doc for version 11g :

Resume :

The JDBC diagnosability management feature introduces an MBean, oracle.jdbc.driver.OracleDiagnosabilityMBean. This MBean provides means to enable and disable JDBC logging.

Description of the MBean :

  • Name :
    • Domain :
    • Name : org.jboss.classloader.spi.base.BaseClassLoader
    • Type : diagnosability
  • Attribute Name : LoggingEnabled (boolean)

Logging with Oracle JDBC Driver

Doc for version 11g :

Logging is done using java.util.logging package provided by Java SE.

To get log output, you must use the debug JAR files, which are indicated with a « _g » in the file name, like ojdbc5_g.jar or ojdbc6_g.jar. The debug JAR file must be included in the CLASSPATH environment variable.

Resume :

This feature logs information about events that occur when JDBC driver code runs. Events can include user-visible events, such as SQL exceptions, running of SQL statements, and detailed JDBC internal events, such as entry to and exit from internal JDBC methods. Users can enable this feature to log specific events or all the events.