You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Olivier Sallou <ol...@irisa.fr> on 2016/09/01 08:39:19 UTC
Docker containerizer: override USER
Hi,
If Docker image specified a USER in Dockerfile, docker will use this user when executing command in container.
In Docker commands, it can be overriden with -u XX .
I do not find however in mesos.proto a way to do so. There is the "arguments" of DockerInfo that I could use to append this to the executor command line, but I think it is not advised as it may not be supported in future.
Did I miss something ?
Thanks
Olvier
Re: Docker containerizer: override USER
Posted by Gilbert Song <gi...@mesosphere.io>.
Yeah, it is a little hard to do it because of backward compatibility.
Gilbert
On Fri, Sep 2, 2016 at 1:14 AM, Olivier Sallou <ol...@irisa.fr>
wrote:
>
>
> ----- Mail original -----
> > De: "Gilbert Song" <gi...@mesosphere.io>
> > À: "dev" <de...@mesos.apache.org>
> > Envoyé: Jeudi 1 Septembre 2016 19:21:06
> > Objet: Re: Docker containerizer: override USER
> >
> > We considered support --user option in docker containerizer.
> Unfortunately,
> > it would
> > potentially break some previous users in behavior. So we did not merge
> it.
> > Please
> > see this JIRA for detail:
> >
> > https://issues.apache.org/jira/browse/MESOS-5754
> >
> > However, you can still use DockerInfo::Parameter to specify your --user
> as a
> > workaround.
>
> That's what I did, but I expected a more *integrated* solution.
>
> Thanks anyway
>
> Olivier
> >
> > Gilbert
> >
> > On Thu, Sep 1, 2016 at 9:15 AM, Olivier Sallou <ol...@irisa.fr>
> > wrote:
> >
> > >
> > >
> > > ----- Mail original -----
> > > > De: "Qian Zhang" <zh...@gmail.com>
> > > > À: dev@mesos.apache.org
> > > > Envoyé: Jeudi 1 Septembre 2016 15:57:39
> > > > Objet: Re: Docker containerizer: override USER
> > > >
> > > > Hi Olivier,
> > > >
> > > > Can you try TaskInfo.CommandInfo.user?
> > >
> > > I will try but mesos.proto specifies:
> > >
> > > // Enables executor and tasks to run as a specific user. If the user
> > > // field is present both in FrameworkInfo and here, the CommandInfo
> > > // user value takes precedence.
> > >
> > > FrameworkInfo.user is specified in my case and set to the expected user
> > > XX. So it does not seem that the container is executed wit the --user
> XX
> > > flag.
> > >
> > > Olivier
> > >
> > >
> > > >
> > > >
> > > > Thanks,
> > > > Qian Zhang
> > > >
> > > > On Thu, Sep 1, 2016 at 4:39 PM, Olivier Sallou <
> olivier.sallou@irisa.fr>
> > > > wrote:
> > > >
> > > > > Hi,
> > > > > If Docker image specified a USER in Dockerfile, docker will use
> this
> > > user
> > > > > when executing command in container.
> > > > > In Docker commands, it can be overriden with -u XX .
> > > > >
> > > > > I do not find however in mesos.proto a way to do so. There is the
> > > > > "arguments" of DockerInfo that I could use to append this to the
> > > executor
> > > > > command line, but I think it is not advised as it may not be
> supported
> > > in
> > > > > future.
> > > > >
> > > > > Did I miss something ?
> > > > >
> > > > > Thanks
> > > > >
> > > > > Olvier
> > > > >
> > > >
> > >
> >
>
Re: Docker containerizer: override USER
Posted by Olivier Sallou <ol...@irisa.fr>.
----- Mail original -----
> De: "Gilbert Song" <gi...@mesosphere.io>
> À: "dev" <de...@mesos.apache.org>
> Envoyé: Jeudi 1 Septembre 2016 19:21:06
> Objet: Re: Docker containerizer: override USER
>
> We considered support --user option in docker containerizer. Unfortunately,
> it would
> potentially break some previous users in behavior. So we did not merge it.
> Please
> see this JIRA for detail:
>
> https://issues.apache.org/jira/browse/MESOS-5754
>
> However, you can still use DockerInfo::Parameter to specify your --user as a
> workaround.
That's what I did, but I expected a more *integrated* solution.
Thanks anyway
Olivier
>
> Gilbert
>
> On Thu, Sep 1, 2016 at 9:15 AM, Olivier Sallou <ol...@irisa.fr>
> wrote:
>
> >
> >
> > ----- Mail original -----
> > > De: "Qian Zhang" <zh...@gmail.com>
> > > À: dev@mesos.apache.org
> > > Envoyé: Jeudi 1 Septembre 2016 15:57:39
> > > Objet: Re: Docker containerizer: override USER
> > >
> > > Hi Olivier,
> > >
> > > Can you try TaskInfo.CommandInfo.user?
> >
> > I will try but mesos.proto specifies:
> >
> > // Enables executor and tasks to run as a specific user. If the user
> > // field is present both in FrameworkInfo and here, the CommandInfo
> > // user value takes precedence.
> >
> > FrameworkInfo.user is specified in my case and set to the expected user
> > XX. So it does not seem that the container is executed wit the --user XX
> > flag.
> >
> > Olivier
> >
> >
> > >
> > >
> > > Thanks,
> > > Qian Zhang
> > >
> > > On Thu, Sep 1, 2016 at 4:39 PM, Olivier Sallou <ol...@irisa.fr>
> > > wrote:
> > >
> > > > Hi,
> > > > If Docker image specified a USER in Dockerfile, docker will use this
> > user
> > > > when executing command in container.
> > > > In Docker commands, it can be overriden with -u XX .
> > > >
> > > > I do not find however in mesos.proto a way to do so. There is the
> > > > "arguments" of DockerInfo that I could use to append this to the
> > executor
> > > > command line, but I think it is not advised as it may not be supported
> > in
> > > > future.
> > > >
> > > > Did I miss something ?
> > > >
> > > > Thanks
> > > >
> > > > Olvier
> > > >
> > >
> >
>
Re: Docker containerizer: override USER
Posted by Gilbert Song <gi...@mesosphere.io>.
We considered support --user option in docker containerizer. Unfortunately,
it would
potentially break some previous users in behavior. So we did not merge it.
Please
see this JIRA for detail:
https://issues.apache.org/jira/browse/MESOS-5754
However, you can still use DockerInfo::Parameter to specify your --user as a
workaround.
Gilbert
On Thu, Sep 1, 2016 at 9:15 AM, Olivier Sallou <ol...@irisa.fr>
wrote:
>
>
> ----- Mail original -----
> > De: "Qian Zhang" <zh...@gmail.com>
> > À: dev@mesos.apache.org
> > Envoyé: Jeudi 1 Septembre 2016 15:57:39
> > Objet: Re: Docker containerizer: override USER
> >
> > Hi Olivier,
> >
> > Can you try TaskInfo.CommandInfo.user?
>
> I will try but mesos.proto specifies:
>
> // Enables executor and tasks to run as a specific user. If the user
> // field is present both in FrameworkInfo and here, the CommandInfo
> // user value takes precedence.
>
> FrameworkInfo.user is specified in my case and set to the expected user
> XX. So it does not seem that the container is executed wit the --user XX
> flag.
>
> Olivier
>
>
> >
> >
> > Thanks,
> > Qian Zhang
> >
> > On Thu, Sep 1, 2016 at 4:39 PM, Olivier Sallou <ol...@irisa.fr>
> > wrote:
> >
> > > Hi,
> > > If Docker image specified a USER in Dockerfile, docker will use this
> user
> > > when executing command in container.
> > > In Docker commands, it can be overriden with -u XX .
> > >
> > > I do not find however in mesos.proto a way to do so. There is the
> > > "arguments" of DockerInfo that I could use to append this to the
> executor
> > > command line, but I think it is not advised as it may not be supported
> in
> > > future.
> > >
> > > Did I miss something ?
> > >
> > > Thanks
> > >
> > > Olvier
> > >
> >
>
Re: Docker containerizer: override USER
Posted by Olivier Sallou <ol...@irisa.fr>.
----- Mail original -----
> De: "Qian Zhang" <zh...@gmail.com>
> À: dev@mesos.apache.org
> Envoyé: Jeudi 1 Septembre 2016 15:57:39
> Objet: Re: Docker containerizer: override USER
>
> Hi Olivier,
>
> Can you try TaskInfo.CommandInfo.user?
I will try but mesos.proto specifies:
// Enables executor and tasks to run as a specific user. If the user
// field is present both in FrameworkInfo and here, the CommandInfo
// user value takes precedence.
FrameworkInfo.user is specified in my case and set to the expected user XX. So it does not seem that the container is executed wit the --user XX flag.
Olivier
>
>
> Thanks,
> Qian Zhang
>
> On Thu, Sep 1, 2016 at 4:39 PM, Olivier Sallou <ol...@irisa.fr>
> wrote:
>
> > Hi,
> > If Docker image specified a USER in Dockerfile, docker will use this user
> > when executing command in container.
> > In Docker commands, it can be overriden with -u XX .
> >
> > I do not find however in mesos.proto a way to do so. There is the
> > "arguments" of DockerInfo that I could use to append this to the executor
> > command line, but I think it is not advised as it may not be supported in
> > future.
> >
> > Did I miss something ?
> >
> > Thanks
> >
> > Olvier
> >
>
Re: Docker containerizer: override USER
Posted by Qian Zhang <zh...@gmail.com>.
Hi Olivier,
Can you try TaskInfo.CommandInfo.user?
Thanks,
Qian Zhang
On Thu, Sep 1, 2016 at 4:39 PM, Olivier Sallou <ol...@irisa.fr>
wrote:
> Hi,
> If Docker image specified a USER in Dockerfile, docker will use this user
> when executing command in container.
> In Docker commands, it can be overriden with -u XX .
>
> I do not find however in mesos.proto a way to do so. There is the
> "arguments" of DockerInfo that I could use to append this to the executor
> command line, but I think it is not advised as it may not be supported in
> future.
>
> Did I miss something ?
>
> Thanks
>
> Olvier
>