engine.Env: comments and tests for Get()

Signed-off-by: Vincent Batts <vbatts@redhat.com>
builder/parser/dumper: Handle newlines appropriately.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
builder/parser: fix handling of empty strings as the only argument.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
builder: Fix a small bug that could improperly cache.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
builder: Fix entrypoint and cmd semantics in evaluator. Test c/o @cnf

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
evaluator: ensure entrypoint stays blank if set blank while CMD is set.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Do not populate path to prevent runconfig merge conflict; remove
autoConfig seeding of entrypoint.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
move entrypoint integration-cli test for blank entrypoint to separate function

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
builder: Fix an error check being done at the wrong spot in run
dispatcher

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Merge pull request #7984 from vbatts/vbatts-engine_env_comments

engine.Env: comments and tests for Get()
Merge pull request #7806 from erikh/fix_cmd_handling_in_parser

Fix cmd and entrypoint handling in parser
Fix #6509: Interactive container hangs when redirecting stdout

Cli IsTerminal() SYS_IOCTL operation should be determined from STDIN,
not from STDOUT.

Signed-off-by: Vojtech Vitek (V-Teq) <vvitek@redhat.com>

Docker-DCO-1.1-Signed-off-by: Vojtech Vitek (V-Teq) <vvitek@redhat.com> (github: rhatdan)
Add DockerCli IsTerminal() check for STDOUT

`docker events > /tmp/out` should not print control
characters to non-terminal STDOUT.

This addresses commit 26b4a4920adca614f6be17a96f254f331271faf0
without creating regression described in issue #6509.

Signed-off-by: Vojtech Vitek (V-Teq) <vvitek@redhat.com>

Docker-DCO-1.1-Signed-off-by: Vojtech Vitek (V-Teq) <vvitek@redhat.com> (github: rhatdan)
Set container_uuid environment

If you are running with systemd as init 1 and specify the container_uuid environment
variable, systemd will create /etc/machine-id with the correct data.

Then on the host you can setup journald to watch the container.

systemd only allows 32 chars in the UUID stored in /etc/machine-id

Then we can later apply a different patch to setup journald to watch
containers from the host and log all syslog/stdout/stderr data together
int the hosts journal.

The following link explains what systemd expects to be setup.

http://www.freedesktop.org/wiki/Software/systemd/ContainerInterface/

This should replace

https://github.com/docker/docker/issues/3506

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Add --security-opts options to allow user to customize security configuration

security-opts will allow you to customise the security subsystem.

For example the labeling system like SELinux will run on a container.

    --security-opt="label:user:USER"   : Set the label user for the container
    --security-opt="label:role:ROLE"   : Set the label role for the container
    --security-opt="label:type:TYPE"   : Set the label type for the container
    --security-opt="label:level:LEVEL" : Set the label level for the container
    --security-opt="label:disabled"    : Turn off label confinement for the container

Since we are passing a list of string options instead of a space separated
string of options, I will change function calls to use InitLabels instead of
GenLabels.  Genlabels interface is Depracated.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Allow docker to search /etc/pki/entitlement for certificate files for RHEL

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Allow setting of environment variables when importing docker images

We want to be able to set the container=docker environment
variable when we build RHEL docker images.  I believe there
will be other use cases where you might want to set
environment in base images.

Since you can do this in layered image, I see no reason not
to allow it in base images.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Automatically relabel volume mounts if user passes :Z with --volume

When you volume mount into a labeled container, we want to allow the
administrator/user the ability to tell docker to fix the labels on the mount.
Using the same basic syntax as the :ro and :rw options on the --volume command

:Z will set the labels so that only the processes within the container can
read/write content.  Since the labels change on creation, this can not be done
by the administrator prior to running the container

:z will change the labels so all containers could read/write content.

drwxr-xr-x. root root system_u:object_r:svirt_sandbox_file_t:s0 /var/run/dan

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Remove TestUsage, since Usage will no longer be shown on failure to parse

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Save "META" field in Dockerfile into image content.

This will allow a user to save META data into an image, which
can later be retrieved using:

docker inspect IMAGEID

I have copied this from the "Comment" handling in docker images.

We want to be able to add json data to an image to describe the image, and
then be able to use other tools to look at this data, to be able to do
security checks based on this data.

We are thinking about adding version names, Perhaps listing the content of the dockerfile.
Descriptions of where the code came from etc.

One option is to call this flag Meta, another would be to call it Vendor.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)