View previous topic :: View next topic |
Author |
Message |
Ahri Tux's lil' helper
Joined: 04 Apr 2004 Posts: 126 Location: Manchester/UK
|
Posted: Fri Sep 12, 2014 9:11 am Post subject: Portage inside Docker? |
|
|
I've begun looking at docker and began reading http://phusion.github.io/baseimage-docker/ which, summarised, says that they've fixed a few things with Ubuntu to avoid issues when it's running inside a Docker container.
I've been using Ubuntu on my laptop for a little while out of laziness but I'm really missing Portage and I got to wondering; is Docker is a great niche for Portage to sit in? Can it survive without Gentoo such that it can manage the contents of the container and defer up to the Docker host for any services/init/syslog/etc-environmental-stuff?
Perhaps I've misunderstood the issues involved in the above Ubuntu issues, and perhaps Portage, too, relies too heavily on assumptions about the environment in which it lives. This seems like the right place to ask whether this is a reasonable question to be asking and whether I should invest time in it! |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21607
|
Posted: Fri Sep 12, 2014 11:00 pm Post subject: |
|
|
As I understand it, Docker is the latest way to bundle dependencies so that the system cannot manage them for you. There is no need to use Docker for a Gentoo system. You could get it to work, since Portage runs fine in containers and Docker is a way to use Linux containers. However, unless you have needs not described above, you are better off ignoring Docker entirely and just running Gentoo as normal. |
|
Back to top |
|
|
wjb l33t
Joined: 10 Jul 2005 Posts: 605 Location: Fife, Scotland
|
Posted: Sat Sep 13, 2014 12:29 pm Post subject: |
|
|
Thing is, once you've configured the container you don't need portage in it anymore and it can be deleted along with anything else you don't need. If you want to update things later, you just make a new container. |
|
Back to top |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Sat Sep 13, 2014 9:17 pm Post subject: |
|
|
@wjb: What's the difference between doing that, and making a chroot with ROOT? |
|
Back to top |
|
|
wjb l33t
Joined: 10 Jul 2005 Posts: 605 Location: Fife, Scotland
|
Posted: Sun Sep 14, 2014 8:40 pm Post subject: |
|
|
The biggie is You can move the image to any 64-bit Linux with docker, and it just runs. Really fast.
I tried it back in June, and was briefly quite excited about it. I mean., try the tianon/gentoo-stage3 container and hack it around a bit - but its 500Mb++ vs the equivalent of ubuntu at 300Mb to run apache and whatever, vs just doing it in portage.
I am confused about docker - its gorgeous, but ... (can't see the point without a data centre) |
|
Back to top |
|
|
luispa Guru
Joined: 17 Mar 2006 Posts: 359 Location: España
|
Posted: Wed Nov 12, 2014 7:09 pm Post subject: |
|
|
I've been playing and dedicating some time to investigate Docker and I can confirm is awesome. It's fast, flexible and simple.
I recently decided to re-create my server (using gentoo during lots of years, only one server) with new Hardware, unfortunately it's going to take several days installing/configuring multiple services. Having all them in containers is a must for the future, so HW migrations, backups, etc. are simple, fast, secure.
My new server has "docker" installed, now I wanted to create a small (like ubuntu or centos) 200-300MB image based on Gentoo. After few days I couldn't create anything usable. Gentoo is not well prepared to create such a image, given you have to start with stage3 and hack it like crazy to remove everything you can, etc... ending with 700MB-1TB images, so a no-go as it's painful to work with such images (speed wise).
My decision as of now: Gentoo server is a docker Host and "all services" on top with "ubuntu" containers (GIT, APACHE, Blog, etc...). Really a pity...
Anyone out there know how to create a minimalistic Gentoo image, is it documented? likely starting on stage1 and adding "just" the minimum?
Regards,
Luis |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21607
|
Posted: Thu Nov 13, 2014 12:18 am Post subject: |
|
|
I would do it the way steveL suggested earlier in this thread. Use ROOT= to install the packages into the container, while keeping a full Gentoo system as the root filesystem. For further space saving, use INSTALL_MASK to limit what is written to the target filesystem. |
|
Back to top |
|
|
luispa Guru
Joined: 17 Mar 2006 Posts: 359 Location: España
|
Posted: Thu Nov 13, 2014 6:59 pm Post subject: |
|
|
@Hu, I don't really get your point. Do you mean use the external Host file system (being also Gentoo) as the Portage of the Container?.
Something like: Code: | -v /usr/portage:/usr/portage:ro -v /usr/portage/distfiles:/usr/portage/distfiles:rw |
If you are referring something else please elaborate HowTo.
Thanks
Luis |
|
Back to top |
|
|
|