Skip to content
This repository was archived by the owner on Jul 6, 2018. It is now read-only.

Docker::Error::ServerError: Invalid registry endpoint on CentOS 7 #25

Closed
marc- opened this issue Mar 5, 2015 · 1 comment
Closed

Docker::Error::ServerError: Invalid registry endpoint on CentOS 7 #25

marc- opened this issue Mar 5, 2015 · 1 comment

Comments

@marc-
Copy link
Contributor

marc- commented Mar 5, 2015

Getting following error when trying to use docker image from private reporistory.

ERROR: machine_image[test] (test-app::default line 18) had an error: 
Docker::Error::ServerError: Invalid registry endpoint https://<server_address>/v1/: 
Get https://<server_address>/v1/_ping: dial tcp: i/o timeout. If this private 
registry supports only HTTP or HTTPS with an unknown CA certificate, 
please add `--insecure-registry <server_address>` to the daemon's 
arguments. In the case of HTTPS, if you have access to the registry's 
CA certificate, no need for the flag; simply place the CA certificate 
at /etc/docker/certs.d/<server_address>/ca.crt

My private repostiry uses ssl with self-signed certificate. I have certificate installed at /etc/docker/certs.d/<server_address>/ca.crt on host system. When I do docker pull <server_address>/<image_name>:<tag> on the same VM it works just fine. Though, machine_image resource fails with error above.

Here is my recipe:

require 'chef/provisioning/docker_driver'

with_driver 'docker'

if platform_family?'rhel'
# Workaround for https://github.com/swipely/docker-api/issues/155 .
# CentOS 7 has docker 1.3.2 version by default wich supports 1.15 Docker API. 
# Default version defined in docker-api is 1.16.
    Docker::API_VERSION='1.15'
end

# create test image
machine_image 'test' do
  recipe 'test-app'
  recipe 'test-app::cleanup'

  machine_options :docker_options => {
      :base_image => {
          :name => 'my-private-docker-registry.org/centos',
          :repository => 'my-private-docker-registry.org/centos',
          :tag => '7'
      }
  }
end
@marc- marc- changed the title Docker::Error::ServerError: Invalid registry endpoint Docker::Error::ServerError: Invalid registry endpoint on CentOS 7 Mar 6, 2015
@marc-
Copy link
Contributor Author

marc- commented Mar 10, 2015

Looks like issue was caused by docker service restart via systemd on the host system. At least when I've removed it error disappeared. Error message seems misleading.

@marc- marc- closed this as completed Mar 10, 2015
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Development

No branches or pull requests

1 participant