Fail comunicating to private docker insecure registry
Sometimes you have to build a private Docker Registry server in your network, but you are not concerned about the security or encryption of your image data trough your local network.
However Docker considers a private registry either secure or insecure. If you follow docker registry documentation, they advise you to add the line below to your /etc/default/docker file at every docker daemon
DOCKER_OPTS="--insecure-registry=dockerlab:5000"
Then, you try to push some imagem to your docker registry and you got the following error:
Get https://dockerlab:5000/v1/_ping: tls: oversized record received with length 20527
The solution: edit the file /etc/docker/daemon.json
{ "insecure-registries": [ "dockerlab:5000" ] }
The reason: /etc/default/docker is specific to upstart. Ubuntu 16.04 and later uses systemd.
For platform-independent configuration, see /etc/docker/daemon.json reference