Exclude `.wh..wh.*` AUFS metadata on layer export

In an effort to make layer content 'stable' between import
and export from two different graph drivers, we must resolve
an issue where AUFS produces metadata files in its layers
which other drivers explicitly ignore when importing.

The issue presents itself like this:

    - Generate a layer using AUFS
    - On commit of that container, the new stored layer contains
      AUFS metadata files/dirs. The stored layer content has some
      tarsum value: '1234567'
    - `docker save` that image to a USB drive and `docker load`
      into another docker engine instance which uses another
      graph driver, say 'btrfs'
    - On load, this graph driver explicitly ignores any AUFS metadata
      that it encounters. The stored layer content now has some
      different tarsum value: 'abcdefg'.

The only (apparent) useful aufs metadata to keep are the psuedo link
files located at `/.wh..wh.plink/`. Thes files hold information at the
RW layer about hard linked files between this layer and another layer.
The other graph drivers make sure to copy up these psuedo linked files
but I've tested out a few different situations and it seems that this
is unnecessary (In my test, AUFS already copies up the other hard linked
files to the RW layer).

This changeset adds explicit exclusion of the AUFS metadata files and
directories (NOTE: not the whiteout files!) on commit of a container
using the AUFS storage driver.

Also included is a change to the archive package. It now explicitly
ignores the root directory from being included in the resulting tar archive
for 2 reasons: 1) it's unnecessary. 2) It's another difference between
what other graph drivers produce when exporting a layer to a tar archive.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Add test for #8307.

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

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
./pkg/archive: clean up Stat_t assertion

inspired by @tonistiigi comment
(https://github.com/docker/docker/pull/8046/files#r19579960)

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Wait for hijack on docker start command

With current implementation there was a possibility
that /start responds quicker than /attach, meaning that
some output would be clipped.

Fixed so the implementation matches with `docker run`.

This also fixes the flaky test results for TestCreateEchoStdout.

Signed-off-by: Tõnis Tiigi <tonistiigi@gmail.com> (github: tonistiigi)
proxy: Fix a potential panic handling error states.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Adding docker-cli run param to set MAC address

Signed-off-by: Malte Janduda <mail@janduda.net>
change util.CopyDirectory to archive.CopyWithTar

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
enhancing set-macaddress docu

Signed-off-by: Malte Janduda <mail@janduda.net>
Fix typo in api docs: stdou -> stdout
Merge pull request #8590 from jfrazelle/8307-iptables-d-restart-fix

On daemon shutdown iptables cleanup successfully
Merge pull request #8863 from vbatts/vbatts-archive_stat

./pkg/archive: clean up Stat_t assertion
Remove `jsonData` argument from `image.StoreImage`

The argument specified the json data to save to disk when registering
a new image into the image graph. If it is nil, then the given image
is serialized to json and that is written by default. This default
behavior is sufficient if the given image was originally deserialzed
from this jsonData to begin with which has always been the case.

Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Merge pull request #8799 from jlhawn/remove_jsondata_arg

Remove `jsonData` argument from `image.StoreImage`
Merge pull request #8924 from pdericson/api-doc-fix

Fix typo in api docs: stdou -> stdout
daemon/container: stream & decode JSON

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
image: stream img JSON & Decode in LoadImage

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
volume: stream JSON & Decode

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
enhancing set-macaddress docu #2

Signed-off-by: Malte Janduda <mail@janduda.net>
Merge pull request #8390 from MalteJ/set-macaddress

Adding docker-cli run param to set MAC address