[systemd-devel] [PATCH 1/4] virt: detect that we are running inside the docker container

Lennart Poettering lennart at poettering.net
Thu Oct 2 02:41:18 PDT 2014


On Thu, 02.10.14 09:57, Michal Sekletar (msekleta at redhat.com) wrote:

Looks good, please commit this one.

> ---
>  src/shared/virt.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/shared/virt.c b/src/shared/virt.c
> index b436895..f9c4e67 100644
> --- a/src/shared/virt.c
> +++ b/src/shared/virt.c
> @@ -310,6 +310,8 @@ int detect_container(const char **id) {
>                  _id = "lxc-libvirt";
>          else if (streq(e, "systemd-nspawn"))
>                  _id = "systemd-nspawn";
> +        else if (streq(e, "docker"))
> +                _id = "docker";
>          else
>                  _id = "other";
>  
> -- 
> 2.0.1
> 
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
> 


Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list