docker-archive / docker-registry

This is **DEPRECATED**! Please go to https://github.com/docker/distribution
Apache License 2.0
2.88k stars 879 forks source link

Insecure Registry on Centos7 refuses to ingest images, even with flag 'insecure-registries' #1089

Open mmelcot opened 7 years ago

mmelcot commented 7 years ago

I try to deploy an insecure Docker Registry on a CentOS7 server:

docker run -d -p 5000:5000 --restart=always --name registry registry:2

I configured docker like this:

# /etc/docker/daemon.json
{ 
    "insecure-registries":["registry.mydomain.com:5000"]
}

With that docker info gives me:

Containers: 1
 Running: 1
 Paused: 0
 Stopped: 0
Images: 2
Server Version: 1.12.4
Storage Driver: devicemapper
 Pool Name: docker-253:2-650870-pool
 Pool Blocksize: 65.54 kB
 Base Device Size: 10.74 GB
 Backing Filesystem: xfs
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 69.86 MB
 Data Space Total: 107.4 GB
 Data Space Available: 50.4 GB
 Metadata Space Used: 708.6 kB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.147 GB
 Thin Pool Minimum Free Space: 10.74 GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Deferred Deletion Enabled: false
 Deferred Deleted Device Count: 0
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 WARNING: Usage of loopback devices is strongly discouraged for production use. Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.135-RHEL7 (2016-09-28)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: null host bridge overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 3.10.0-327.36.3.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 489.1 MiB
Name: ASB-Registry
ID: KNQD:2AVN:EG5H:VV7U:US7G:SJ2D:G2FY:UAZK:N2NY:FQAA:CQJV:N2IS
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
Insecure Registries:
 registry.mydomain.com:5000
 127.0.0.0/8

So:

 registry.mydomain.com:5000
 127.0.0.0/8

Appears correctly.

However, when I try to push a container to that registry: docker push registry.mydomain.com:5000/my_image

I get the following log:

The push refers to a repository [registry.mydomain.com:5000/my_image]
Get https://registry.mydomain.com:5000/v1/_ping: http: server gave HTTP response to HTTPS client

The docker version I use:

Version: 1.12.4 
API version: 1.24