Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootable containers #10

Merged
merged 3 commits into from
Aug 2, 2017
Merged

Bootable containers #10

merged 3 commits into from
Aug 2, 2017

Conversation

petrosagg
Copy link
Contributor

This PR introduces another type of containers, namely bootable containers, that are meant to be used to bootstrap a system. The distinction is achieved by specifying the bare runtime instead of the default runc. This disables some actions performed by Docker that interfere with the boot process.

This PR also adds a new command, mobynit, which is meant to be statically compiled and run as PID 1 of a system running bootable containers. This commands contains the absolute minimal code to assemble the root partition of a bootable container, pivot root, and start the normal init process.

The sysroot is mounted at /mnt/sysroot of the container mount namespace to allow the bootable container to update itself.

Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
Containers that are meant to be booted from do not need the initLayer.

The default init layer shadows /etc/resolv.conf and other files from the
filesystem but this can cause problems if we're bootstrapping the
system.

Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
@petrosagg petrosagg requested a review from zozo123 August 2, 2017 00:21

func init() {
flag.StringVar(&graphDriver, "storage-driver", "aufs", "Storage driver to use")
flag.StringVar(&graphDriver, "s", "aufs", "Storage driver to use")
Copy link
Contributor

@zozo123 zozo123 Aug 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second flag.StringVar will override the first one. I am not sure I get this. https://play.golang.org/p/7Pr_o3He8V

Copy link
Contributor

@zozo123 zozo123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I am not sure I quite understand the 2 successive flag.StringVar

@petrosagg petrosagg merged commit 93710d6 into 17.06-resin Aug 2, 2017
@petrosagg petrosagg deleted the bootable-containers branch August 4, 2017 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants