Docker credentials helper: can't get it working

I tested the configuration for using a credential helper but docker push seems to ignore the .docker/config.json in my home directory.
This is what I have https://gist.github.com/samuelbernardo/975288e89c86082e47cc4528b1c75c69
I’m trying to create a bash script to parse environment variables and give the expected answers to username and password.
The current helper code have only debug purposes to understand the protocol and create the expected functions.
I used to different GNU/Linux distros: Gentoo and Arch. Neither work with the most updated docker version.
I’m using OS with CPU x86 64bit arch.

Doesn’t look like a valid config file.

You can simply call docker login with the --username and --password-stdin parameters. More infos in the docs.