New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP/Insecure repository: http: server gave HTTP response to HTTPS client #28321

Closed
ktamiola opened this Issue Nov 11, 2016 · 6 comments

Comments

Projects
None yet
7 participants
@ktamiola

ktamiola commented Nov 11, 2016

Description
I am trying to setup a local insecure repository on VM running Ubuntu 16.04.1 image. I have followed official configuration guide for local registry and created a daemon.json placed in /etc/docker/daemon.json. I have also modified the contents of /etc/default/docker according to manual. Unfortunately, no luck with plain HTTP repository. Help!

daemon.json

{
    "insecure-registries": ["10.0.0.15:5000"]
}

Command
I am attempting to connect from a different host (10.0.0.1, with full access permissions for 10.0.0.15) and push to 10.0.0.15:5000.

docker push 10.0.0.15:5000/peptone-rpc-controller

Error:

The push refers to a repository [10.0.0.15:5000/peptone-rpc-controller]
Get https://10.0.0.15:5000/v1/_ping: http: server gave HTTP response to HTTPS client

docker info

Containers: 2
 Running: 1
 Paused: 0
 Stopped: 1
Images: 1
Server Version: 1.12.3
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 19
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: host null bridge overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: apparmor seccomp
Kernel Version: 4.4.0-47-lowlatency
Operating System: Ubuntu 16.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 488.3 MiB
Name: peptone-registry
ID: EK2K:QGNT:4WSX:XFZ3:2LX6:2BR3:LUYV:2U66:4OCF:O4TZ:ZXWO:PY3X
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Insecure Registries:
 10.0.0.15:5000
 127.0.0.0/8

/etc/default/docker

# Docker Upstart and SysVinit configuration file

#
# THIS FILE DOES NOT APPLY TO SYSTEMD
#
#   Please see the documentation for "systemd drop-ins":
#   https://docs.docker.com/engine/articles/systemd/
#

# Customize location of Docker binary (especially for development testing).
#DOCKERD="/usr/local/bin/dockerd"

# Use DOCKER_OPTS to modify the daemon startup options.
DOCKER_OPTS="--insecure-registry 10.0.0.15:5000"

# If you need Docker to use an HTTP proxy, it can also be specified here.
#export http_proxy="http://127.0.0.1:3128/"

# This is also a handy place to tweak where Docker's temporary files go.
#export TMPDIR="/mnt/bigdrive/docker-tmp"
@ktamiola

This comment has been minimized.

Show comment
Hide comment
@ktamiola

ktamiola Nov 11, 2016

It seems the only way to set insecure registry flag is to add,

{
    "insecure-registries": ["10.0.0.15:5000"]
}

to /etc/docker/daemon.json. On Ubuntu 16.04.1 modifications to /etc/default/docker/ seem not to work for insecure registry.

ktamiola commented Nov 11, 2016

It seems the only way to set insecure registry flag is to add,

{
    "insecure-registries": ["10.0.0.15:5000"]
}

to /etc/docker/daemon.json. On Ubuntu 16.04.1 modifications to /etc/default/docker/ seem not to work for insecure registry.

@ktamiola ktamiola closed this Nov 11, 2016

@thaJeztah

This comment has been minimized.

Show comment
Hide comment
@thaJeztah

thaJeztah Nov 18, 2016

Member

Correct, that file is not used on systems using systemd as an init system; see the message at the top;

# THIS FILE DOES NOT APPLY TO SYSTEMD
#
#   Please see the documentation for "systemd drop-ins":
#   https://docs.docker.com/engine/articles/systemd/
#

So either use a daemon.json file, or use systemd drop-in files

Member

thaJeztah commented Nov 18, 2016

Correct, that file is not used on systems using systemd as an init system; see the message at the top;

# THIS FILE DOES NOT APPLY TO SYSTEMD
#
#   Please see the documentation for "systemd drop-ins":
#   https://docs.docker.com/engine/articles/systemd/
#

So either use a daemon.json file, or use systemd drop-in files

@abhtibco

This comment has been minimized.

Show comment
Hide comment
@abhtibco

abhtibco Jan 30, 2017

@ktamiola Thanks!! This solution works for Ubuntu16.04

abhtibco commented Jan 30, 2017

@ktamiola Thanks!! This solution works for Ubuntu16.04

@MikeMitterer

This comment has been minimized.

Show comment
Hide comment
@MikeMitterer

MikeMitterer Feb 23, 2017

Had the same problem on Mac 10.11. It was not clear to me where to set the "insecure-registries" option on Mac. I think on Mac the /etc/docker/daemon.json is ignored but!! instead we have a nice GUI:
capturfiles-20170223_091129

Where kdeneon in this case is where the private registry runs.
Hope this helps someone!

MikeMitterer commented Feb 23, 2017

Had the same problem on Mac 10.11. It was not clear to me where to set the "insecure-registries" option on Mac. I think on Mac the /etc/docker/daemon.json is ignored but!! instead we have a nice GUI:
capturfiles-20170223_091129

Where kdeneon in this case is where the private registry runs.
Hope this helps someone!

@saavkaar

This comment has been minimized.

Show comment
Hide comment
@saavkaar

saavkaar Mar 16, 2017

Try adding --insecure-registry option to daemon in /etc/systemd/system/docker.service.d/docker.conf file.
Then sudo systemctl daemon-reload
And sudo service docker restart

It worked for me

OS: Ubuntu 16.04
Docker: 1.26

saavkaar commented Mar 16, 2017

Try adding --insecure-registry option to daemon in /etc/systemd/system/docker.service.d/docker.conf file.
Then sudo systemctl daemon-reload
And sudo service docker restart

It worked for me

OS: Ubuntu 16.04
Docker: 1.26

@selfup

This comment has been minimized.

Show comment
Hide comment
@selfup

selfup Oct 21, 2017

@MikeMitterer thanks for that screenshot! Works great 👍

selfup commented Oct 21, 2017

@MikeMitterer thanks for that screenshot! Works great 👍

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