-
Notifications
You must be signed in to change notification settings - Fork 7
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
Where did rootfs.tar.gz come from, and can we trim it down? #14
Comments
@wking @mrunalp , For example, roofs from busybox lacks of libapparmmour.so, and the ps binary in it is not support "ps -Z" cmd, thus, the validating of apparmmour and selinux of specs should be blocked. Anyway, we can do validating using syscalls from Linux kernel, but I think it should be complicated and resulting the annoying code appeared in the validating tool. Thanks. |
On Sat, Dec 05, 2015 at 09:07:31PM -0800, LinZhinan(Zen Lin) wrote:
I agree that its worth putting tools like that into the rootfs once |
@wking The default came from an extracted docker image. I am +1 to making it more minimal. |
@zenlinTechnofreak I think it shouldn't be too hard to validate selinux (not sure about apparmore). We can modify the rootfs as required when we get there. |
@mrunalp I am doing investigate about these two validation items, will shared the results later. |
+1. |
Closed by opencontainers/runtime-tools#3. |
The tarball landed in d3e2985 (Add a script to prepare a rootfs for testing, 2015-10-13). It looks like it's mostly BusyBox and symlinks to BusyBox:
but there's a lot of other stuff in there too:
Your BusyBox seems to be dynamically linked:
So I'd replace it with a statically linked version (that's what Gentoo distributes by default).
We can drop all the
/dev
stuff,/proc
, and/sys
because of opencontainers/runtime-spec#164, which is part of v0.1.1:/home
,/linuxrc
(one of the BusyBox links),/media
,/mnt
,/opt
, and/root
all look pretty useless, so I'd drop them too.In wking/oci-gentoo-minimal, I've had good results moving
/lib
to/lib64
, which lets us avoid:although that would depend on you getting a static BusyBox without the
/lib/ld64-uClibc.so.0
linking (see earlier comments). In fact, I don't think we'll have any non-BusyBox commands left in a trimmed-down tarball, so you can probably drop all thelib*
directories.Shifting all the BusyBox links into
/bin
and droppinggetconf
,ldd
, and theiptables-xml
symlink would let us drop/usr/bin
. You don't seem to be usinggetconf
,ldd
, oriptables-xml
in your tests./usr/sbin
is some more BusyBox links,brctl
, and someiptables
stuff. Unless you're testing nested containers, you shouldn't need the non-BusyBox stuff there. Although both your current BusyBox and Gentoo's stock version includebrctl
, so you could replace your currentbrctl
with a BusyBox link if you needbrctl
inside the container./sbin
has more BusyBox links which I'd move to/bin
, and a dozen or so other utilities. The only one that looks useful there isip
, and both your current BusyBox and Gentoo's stock version includeip
./usr/share
is just some udhcpc stuff, which the test bundle can drop in favor of explicit networking setup viaip
.Moving into
/etc
, I think the only things you need to keep aregroup
,mtab
,passwd
, andresolv.conf
(the last of which can be just a blank file over which you mount the host's version, see here, although that's using obsolete mount syntax).Anyhow, if any of that sounds reasonable, I'm happy to PR something like this that will setup your rootfs from the current Gentoo stage3.
The text was updated successfully, but these errors were encountered: