All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] add option to run docker with initramfs
@ 2019-06-12 16:18 Fragkiskos Sigalas
  2019-06-12 20:18 ` Yann E. MORIN
  0 siblings, 1 reply; 4+ messages in thread
From: Fragkiskos Sigalas @ 2019-06-12 16:18 UTC (permalink / raw)
  To: buildroot

Hi,

By default docker uses pivot_root which is not available in initramfs. The
way to override the default behaviour is to define an environment variable
DOCKER_RAMDISK when starting the daemon (weirdly enough there appears to be
no respective command line option).

Would it make sense to add such an option in the docker package?

Regards,
Frank
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20190612/3cedf989/attachment.html>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] add option to run docker with initramfs
  2019-06-12 16:18 [Buildroot] add option to run docker with initramfs Fragkiskos Sigalas
@ 2019-06-12 20:18 ` Yann E. MORIN
  2019-06-12 21:41   ` Christian Stewart
  2019-06-12 21:53   ` Fragkiskos Sigalas
  0 siblings, 2 replies; 4+ messages in thread
From: Yann E. MORIN @ 2019-06-12 20:18 UTC (permalink / raw)
  To: buildroot

Frank, All,

On 2019-06-12 19:18 +0300, Fragkiskos Sigalas spake thusly:
> By default docker uses pivot_root which is not available in initramfs.

pivot_root is provided by either util-linux or busybox; it has (AFAICT)
no relation to whether running from an initramfs or any other filesystem).

Our default configuration for busybox eeven enables pivot_root.

So, it looks like your could very well add pivot_root to your initramfs,
in fact.

Regards,
Yann E. MORIN.

> The way to override the default behaviour is to define an
> environment variable DOCKER_RAMDISK when starting the daemon (weirdly enough there appears to be no respective command line option).
> Would it make sense to add such an option in the docker package?



-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] add option to run docker with initramfs
  2019-06-12 20:18 ` Yann E. MORIN
@ 2019-06-12 21:41   ` Christian Stewart
  2019-06-12 21:53   ` Fragkiskos Sigalas
  1 sibling, 0 replies; 4+ messages in thread
From: Christian Stewart @ 2019-06-12 21:41 UTC (permalink / raw)
  To: buildroot

Frank, all,

Frank is referring to a docker environment variable that must be set in
order to change the root pivot step to be compatible with a ramfs

I do this in my SkiffOS project,

system/docker.service.d/ramdisk.conf

[Service]
Environment=DOCKER_RAMDISK=true

On Wed, Jun 12, 2019, 1:19 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote:

> > By default docker uses pivot_root which is not available in initramfs.
>
> pivot_root is provided by either util-linux or busybox; it has (AFAICT)
> no relation to whether running from an initramfs or any other filesystem).
>
> Our default configuration for busybox eeven enables pivot_root.
>

This is more related to docker behavior than busybox or anything else.

Best,
Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20190612/61264a19/attachment.html>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] add option to run docker with initramfs
  2019-06-12 20:18 ` Yann E. MORIN
  2019-06-12 21:41   ` Christian Stewart
@ 2019-06-12 21:53   ` Fragkiskos Sigalas
  1 sibling, 0 replies; 4+ messages in thread
From: Fragkiskos Sigalas @ 2019-06-12 21:53 UTC (permalink / raw)
  To: buildroot

Yann, All,

In order to use pivot_root a real device is needed, alas initramfs space is
not a real one.
Config.in for util-linux in busybox states:

The pivot_root utility swaps the mount points for the root filesystem
        with some other mounted filesystem. This allows you to do all sorts
        of wild and crazy things with your Linux system and is far more
        powerful than 'chroot'.

        Note: This is for initrd in linux 2.4. Under initramfs (introduced
        in linux 2.6) use switch_root instead.

So in case of initramfs switch_root should be used instead. I think that
dockerd
uses MS_MOVE with chroot, but this is of less or no importance.

On Wed, Jun 12, 2019 at 11:19 PM Yann E. MORIN <yann.morin.1998@free.fr>
wrote:

> Frank, All,
>
> On 2019-06-12 19:18 +0300, Fragkiskos Sigalas spake thusly:
> > By default docker uses pivot_root which is not available in initramfs.
>
> pivot_root is provided by either util-linux or busybox; it has (AFAICT)
> no relation to whether running from an initramfs or any other filesystem).
>
> Our default configuration for busybox eeven enables pivot_root.
>
> So, it looks like your could very well add pivot_root to your initramfs,
> in fact.
>
> Regards,
> Yann E. MORIN.
>
> > The way to override the default behaviour is to define an
> > environment variable DOCKER_RAMDISK when starting the daemon (weirdly
> enough there appears to be no respective command line option).
> > Would it make sense to add such an option in the docker package?
>
>
>
> --
>
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics'
> conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___
>      |
> | +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is
> no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v
>  conspiracy.  |
>
> '------------------------------^-------^------------------^--------------------'
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20190613/ff6a5296/attachment.html>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-06-12 21:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-12 16:18 [Buildroot] add option to run docker with initramfs Fragkiskos Sigalas
2019-06-12 20:18 ` Yann E. MORIN
2019-06-12 21:41   ` Christian Stewart
2019-06-12 21:53   ` Fragkiskos Sigalas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.