Check /etc/resolv.conf every time for 127.* content

Currently if you start the docker -d on a system with 127.0.0.1 in /etc/resolv.conf
It will set the default dns to 8.8.8.8 8.8.4.4 permanently.

This causes a problem at boot on Fedora machines where NetworkManager has not
populated /etc/resolv.conf before docker gets started.

This fix checks /etc/resolv.conf on every docker run. And only populates
daemon.config.Dns  if the user specified it on the command line.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Test for check /etc/resolv.conf on every docker run for 127.* content.

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Fix Tag Test for longer tags

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Merge pull request #8463 from jfrazelle/fix-invalid-tag-test

Fix Tag Test for longer tags
pass extra file to child process as status handler

When stdout/stderr is closed prematurely, the proxy's writes to stdout/stderr
(i.e. `log.Errorf/log.Printf`) will returns with EPIPE error, and go runtime
will terminate the proxy when stdout/stderr writes trigger 10 EPIPE errors.

instead of using stdout/stderr as the status handler, we pass an extra file to
the child process and write `0\n` or `1\nerror message` to it and close it
after. This allow the child process to handle stdout/stderr as normal.

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
Restore volume refs after daemon restart

Volume refs were not being restored on daemon restart.
This made it possible to remove a volume being used by other containers
after a daemon restart.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Fixes re-creating volume on (re)start

When a container is restarted all the volume configs are parsed again.
Even if the volume was already handled in a previous start it was still
calling "FindOrCreateVolume" on the volume repo causing a new volume to
be created.

This wasn't being detected because as part of the mount initialization
it checks to see if the the _mount_ was already initialized, but this
happens after the parsing of the configs.
So a check is added during parsing to skip a volume which was already
created for that container.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Merge pull request #8472 from cpuguy83/fix_volume_refs_on_daemon_restore

Restore volume refs after daemon restart
Merge pull request #8475 from cpuguy83/fix_create_phantom_volumes_on_container_restart

Fixes re-creating volume on (re)start
Merge pull request #8450 from dqminh/fix-proxy-exit

dont close proxy's stdout/stderr prematurely
cleanup resolve.conf code

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Merge pull request #8457 from jfrazelle/pr_8455

Check /etc/resolv.conf every time for 127.* content
Bump the API version for content-type:x-json-stream change to 1.16

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)