docker pull/push not working with insecure registry - docker

I installed docker toolbox and I am trying to connect to my private registry.
I added the following to /var/lib/boot2docker/profile
EXTRA_ARGS='
--label provider=virtualbox --insecure-registry http://myregistry.com:80
'
I am able to login to the registry successfully. But when I try to pull/push from/to the registry, I get the following error.
Error response from daemon: unable to ping registry endpoint
https://myregistry.com:80/v0/ v2 ping attempt failed with error: Get
https://myregistry.com:80/v2/: tls: oversized record received with
length 20527 v1 ping attempt failed with error: Get
https://myregistry.com:80/v1/_ping: tls: oversized record received
with length 20527
Any help would be appreciated. Thanks

I was able to resolve the issue.
instead of
--insecure-registry http://myregistry.com:80
I did
--insecure-registry=myregistry.com
and it worked

The main way to debug, as in issue 958, is to run the daemon docker in debug:
docker -D -d
In your case, the v2 registry was not able to be contacted and then attempted v1, giving the error you see.
The logs should tell you more.
Make sure you have followed Deploying a plain HTTP registry.

Related

Unable to pull image from the Gitlab container registry

I have created some images in the Gitlab Container Registry. I am unable to pull them using docker on my local system. The login command succeeds but when I type the following command:
docker pull reg-gitlab-project.company.com/services/palimited/integrationservices/springbootproject/springbootproject:latest
I am getting the following error
Error response from daemon: Head "https://reg-gitlab-project.company.com/v2/services/palimited/integrationservices/springbootproject/springbootproject/manifests/latest": denied: access forbidden
I am unable to figure out why this error is occuring? Can anyone guide me.
You need to authenticate with the container registry at reg-gitlab-project.company.com before issuing a docker pull command.
See, GitLab Docs: Authenticate with the Container Registry.

How to cut addressing to external resource registry-1.docker.io in GitLab Code Quality Docker image?

How to cut addressing to external resource registry-1.docker.io in GitLab Code Quality Docker image?
I have docker image from the registry.gitlab.com/gitlab-org/ci-cd/codequality:0.85.24
After I injected this image to my .gitlab-ci.yml I get the following error:
Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp 52.55.168.20:443: connect: connection refused
Unable to find image 'codeclimate/codeclimate:0.85.23' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp 3.224.96.239:443: connect: connection refused.
See 'docker run --help'.
I understand that I can use a proxy to addressing this address, but access to external resources is denied in our gitlab registry.
However, this error occurs during the execution of the command in gitlab-ci:
- docker run \
--env SOURCE_CODE="$PWD" \
--volume "$PWD":/code \
--volume /var/run/docker.sock:/var/run/docker.sock \
You can use a private registry for pulling Code Quality images:
https://docs.gitlab.com/ee/user/project/merge_requests/code_quality.html#configure-code-quality-to-use-a-private-container-image-registry
Not only can you use a private registry for pulling Code Quality images, but since GitLab 15.5 (October 2022):
Use Code Quality with a private, authenticated image registry
The Code Quality scanner downloads and runs container images to scan your code.
Previously, you could pull these images from a custom image registry, but you couldn’t use a private registry that required authentication.
Now, you can provide a registry username and password by setting CI/CD variables when you include the Code Quality CI/CD template.
See Documentation and Issue.

Docker Error when proxy is set : proxyconnect tcp: dial tcp: lookup http: no such host

I am facing one weird issue with docker. We have a corporate proxy and using docker on Windows server 2016.
I am trying to pull docker image from dockerhub.
Started facing this issue recently. It was working fine earlier.
Steps
1) Set HTTP and HTTPS Proxy
2) Executed docker pull hello-world:nanoserver
Error response from daemon: Get https://registry-1.docker.io/v2/: proxyconnect tcp: dial tcp: lookup http: no such host
Any idea whats going wrong here. I have couple of other machines having same setting and works fine.
Update 1: 06/03/2019
I did some trial and error and found that docker version is the culprit here.
I installed docker 17.06.2-ee-17, 17.06.2-ee-16 and tried pulling image. It worked fine.
So now question is what is wrong with latest 3 versions of docker ee for windows. i.e 17.06.2-ee-18,17.06.2-ee-19,17.06.2-ee-20 which is giving me this error.
We had exactly the same issues.
It appears to work in the newer versions when we used the fully qualified version of our proxy server.
i.e. http://proxy-server.my-domain.net:8080 instead of http://proxy-server:8080
Sorry, My answer is for Linux ("Error response from daemon: Get https://registry-1.docker.io/v2/:Proxyconnect tcp: dial tcp:lookup proxy.example.com:no such host")
Firsty check docker version with this command ($docker -v )
Output: Docker version 19.03.10, build 9424aeaee9 (Can be any version)
Check Can you ping to google ($ping google.com )
If it work, dont need to fix the file (/etc/hosts and /etc/resolv.conf)
$sudo snap install docker
Then check PATH environment variable
$echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin ( Output must be like this)
The output doesn't include /snap/bin path. You can define with below command
$export -n PATH=$PATH:/snap/bin
$echo $PATH ( check with this command )
Now login to docker hub
$docker login
When login succeeded,can pull any images from docker hub
$docker pull hello-world

Error response from daemon: Get https://registry-1.docker.io/v2/: Forbidden

i am new to docker ,installed docker for windows 10 : version 18.06.0-ce, build 0ffa825
i tried to execute the first docker pull command but it doesn't succeed , i am beside a corporate proxy and the connection to docker server is working fine .
here is what i got :
PS C:\WINDOWS\system32> docker pull microsoft/nanoserver
Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/: Forbidden.
when i call the link https://registry-1.docker.io/v2/ on the browser i get:
{"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":null}]}
edit :
after changing the proxy address i had :
Error response from daemon: Get https://registry-1.docker.io/v2/: Proxy Authentication Required
i have followed the same as windows docker behind a corporate proxy: ,but still i facing the same issue.
The normal solution to this is just docker logout, that's solved it every time anybody I know has it it. Somehow docker gets its credentials out of order or something.
After a lot of search i solved the issue by following this step ,
it may work or not depending on you corporate proxy.
find bellow the steps i followed :
install the cntlm from : cntlm.sourceforge.net
connect to your corporate web proxy using this command :
cntlm -H -u username -d domainname .
username :your domain/proxy account name
domainname: the actual domain name
finally you can execute : docker pull

Unable to pull docker image, getting 'remote error: access denied'

I'm trying to check the installation docker pull hello-world
But getting the following error:
Pulling repository hello-world
Get https://index.docker.io/v1/repositories/library/hello-world/images: remote error: access denied
I have CentOS 6.5
Docker version 1.7.1, build 786b29d/1.7.1
I'm in a corporate network but curl https://index.docker.io/v1/repositories/library/hello-world/images forks fine.
What might be the issue?
Thanks in advance!
I got this error while I was trying to pull mongodb image instead of mongo.
So make sure image name is correct. The very same error message happens on both run and pull commands.
Had the same problem & error on the host working via proxy.
In essence - if you are behind an HTTP proxy server, you will need to add proxy configuration in the Docker systemd service file.
https://docs.docker.com/engine/admin/systemd/
(See at "HTTP proxy" section).
This helped me.
Did you add your user in docker group
https://docs.docker.com/engine/installation/linux/centos/#/create-a-docker-group
Otherwise, you should execute docker command with sudo before
docker pull hello-world

Resources