Skip to content

Instantly share code, notes, and snippets.

@SalmonKing72
Last active July 7, 2021 11:44
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save SalmonKing72/58d73b733a81a5c0478d90408e175ed9 to your computer and use it in GitHub Desktop.
Save SalmonKing72/58d73b733a81a5c0478d90408e175ed9 to your computer and use it in GitHub Desktop.
docker-machine: adding insecure registry configuration to an existing machine/VM

The issue

  • deployed a local docker registry container to a docker-machine VM
  • cannot push to local docker registry
  • get an error including a message similar to, "http: server gave HTTP response to HTTPS client"

The solution

  • in order to push to this local registry you need to make some modifications to your docker VM
  • open c:\users\<user-name>\.docker\machine\machines\default\config.json or ~/.docker/machine/machines/default/config.json in an editor
  • find the InsecureRegistry property and append "localhost:5000" to it
  • go to your docker terminal
  • docker-machine provision default
  • once complete, run docker info
  • you should see your modification to the insecure registries (e.g. in the truncated output below)
ID: OIKM:PIVF:VPVC:OUV6:SREK:FS4W:6OF4:M2YY:DG2R:NINO:QE2D:U6EQ
Docker Root Dir: /mnt/sda1/var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 16
 Goroutines: 25
 System Time: 2017-08-04T14:50:05.335227242Z
 EventsListeners: 0
Registry: https://index.docker.io/v1/
Labels:
 provider=virtualbox
Experimental: false
Insecure Registries:
 localhost:5000
 127.0.0.0/8
Live Restore Enabled: false
@qgervacio
Copy link

Thank you. Fixed by adding just docker-machine-ip:5000 in Docker > Preferences... > Insecure registries

@akhilhada
Copy link

Thank you. I could see the entry after running docker-machine provision default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment