However, I have configured http_proxy and https_proxy as environment variables in the shell and also in /etc/sysconfig/docker. Further, wget of the above URL completes but returns just two characters: .
I also tried: ‘docker pull Quay’. Same issue. However, wget of that URL succeeds and returns valid content.
Please let me know what could be going wrong here.
If you are on a systemd system, then /etc/sysconfig/docker may not be the correct place to configure an environment variable.
Here’s a tip to see what environment variables any given process on a system has:
cat /proc/<pid>/environ | sed 's/\x0/\n/g'
You can use that to validate that your init system is setting the variables you expect it to.
Usually in a systemd system, you’ll need to set the environment variables in the systemd unit or systemd unit override file. Details on doing that can be found here.
The official registry actually has nothing to do with index.docker.io. The actual registry address is going to be registry-2.docker.io instead. The official registry no longer runs the v1 registry, so any test to the v1 registry will definitely fail. The reason you’re seeing the v1 output in the error you’re getting is that it falls back to v1 after a v2 failure. This exact behavior can vary depending on the actual version of docker you’re running.
What’s the full output of docker version and docker info?
With your pointers, I could verify that the http_proxy is set in the
dockerd process environment. Now, ‘docker run hello-world’ is able to pull
the hello-world image and proceed one step further.
Unfortunately, it is only one step further: it still fails with an error. I
should mention that, to fix error messages that docker-runc is not defined,
I have symlink’d: “/usr/bin/docker-runc -> /usr/bin/runc”, where runc
version is as below:
runc version 1.0.0-rc3
commit: b3fc8307fbabf7c95a1bed604c751e901b7553fe-dirty
spec: 1.0.0-rc5
The error output from ‘docker run hello-world’ is this:
<error_output>
Incorrect Usage.
NAME:
docker-runc create - create a container
<<… docker-runc man page … >>
flag provided but not defined: -console
/usr/bin/docker-current: Error response from daemon: oci runtime error:
flag provided but not defined: -console.
</error_output>
Here’s more information: # docker version
Client:
Version: 1.12.6
API version: 1.24
Package version: docker-common-1.12.6-16.el7.centos.x86_64
Go version: go1.7.4
Git commit: 3a094bd/1.12.6
Built: Fri Apr 14 13:46:13 2017
OS/Arch: linux/amd64
Though the ‘docker run hello-world’ command fails, the container is created but not running. The ‘docker ps -a’ shows multiple containers in Created state.
Looking at /var/log/messages, I don’t see where the ‘-console’ argument is passed. Here is the /var/log/messages file after running the command ( I cleared all previous entries):
Resolved the issue myself. Reinstalled all docker-related components, removed a spurious docker.service in /etc/systemd/system and used the default docker.service in /usr/lib/systemd/system . For good measure, I also added overlay2 as storage driver.