agent: syslog: explicitly use image CMD

docker 1.2+ does not implicitly make use of the image CMD if the
ENTRYPOINT has been explicitly set on the container. Therefore, in order
to decorate the ENTRYPOINT, we have to also explicitly copy over the CMD
from the image config to the container config.

https://github.com/docker/docker/pull/6909
https://github.com/docker/docker/issues/7437
@dano yea I saw that the docker API returns the same data in "config" as
"container_config" so I was curious why the redundancy.

On Monday, November 17, 2014, Daniel Norberg <notifications@github.com>
wrote:

> In
> helios-services/src/main/java/com/spotify/helios/agent/SyslogRedirectingContainerDecorator.java:
>
> > @@ -57,8 +57,9 @@ public void decorateHostConfig(HostConfig.Builder hostConfig) {
> >    @Override
> >    public void decorateContainerConfig(Job job, ImageInfo imageInfo,
> >                                        ContainerConfig.Builder containerConfig) {
> > -    ContainerConfig imageConfig = imageInfo.containerConfig();
> > +    ContainerConfig imageConfig = imageInfo.config();
>
> @drewcsillag <https://github.com/drewcsillag> Not sure about the rename.
> containerConfig is already used by the parameter with the same name,
> which actually holds the config of the container we're about to start.
> imageConfig is the config of the image used by the container.
>
> @davidxia <https://github.com/davidxia> dockerd seems to provide the
> inherited/effective CMD in imageInfo.config. API docs are not very
> informative on this point. Might be worth investigating a bit more.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/spotify/helios/pull/299/files#r20475308>.
>


-- 
David Xia
Software Engineer
dxia@spotify.com