Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 535742 - Provide an official gentoo docker image
Summary: Provide an official gentoo docker image
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Release Media
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo Release Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-06 02:14 UTC by Thomas Capricelli
Modified: 2020-08-24 20:00 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Capricelli 2015-01-06 02:14:20 UTC
In docker, images are making up a hierarchy through inheritance. Most of images (if not all) currently inherit from some ubuntu official image :

    https://registry.hub.docker.com/_/ubuntu/

I for one would be really interested in creating all my images on top of gentoo. I'm probably not alone there.

In the world of gentoo, things are slightly more complicated. We probably don't want the portage tree available in the image. Rather we should "mount" the one from the (gentoo) host so that we can install more packages in inherited images.

There are some gentoo images, but (afaik) no official ones yet. Some previous work can be found on the docker registry. For example :

    https://registry.hub.docker.com/search?q=gentoo-base

Reproducible: Always
Comment 1 Thomas Capricelli 2015-01-20 02:32:26 UTC
I could help, or even do/maintain those. But i would need some help/mentoring.
Comment 2 ChaosEngine 2015-02-10 22:23:39 UTC
Maybe a bootstrap image derived from scratch (https://registry.hub.docker.com/u/library/scratch/) would do.
Just for starters.
Next we could build on top of that, by adding stage3 image (and add tagging).

Portage tree should not be included and only upon explicit syncing will be availalble (just as # apt-get update; from debian based images) 

I'll try to prepare Dockerfile for this.
Comment 3 ChaosEngine 2015-02-10 22:35:57 UTC
Tianon Gravi seems to have all the anaswers:

https://github.com/tianon/docker-gentoo-stage3
Comment 4 Thomas Capricelli 2015-02-10 22:45:11 UTC
(In reply to ChaosEngine from comment #3)
> Tianon Gravi seems to have all the anaswers:
> 
> https://github.com/tianon/docker-gentoo-stage3

not sure about what it does. Seems to create a docker file from stage3, but why calling the script update ?

Doesn't work from here (uptodate gentoo):

orzel@berlioz /tmp% bash ~/clones/docker-gentoo-stage3/update.sh 
+ wget -N 'http://distfiles.gentoo.org/releases/amd64/autobuilds/20141204/stage3-amd64-20141204.tar.bz2 207889127'
--2015-02-10 23:43:54--  http://distfiles.gentoo.org/releases/amd64/autobuilds/20141204/stage3-amd64-20141204.tar.bz2%20207889127
Resolving distfiles.gentoo.org... 216.165.129.135, 64.50.236.52, 156.56.247.195, ...
Connecting to distfiles.gentoo.org|216.165.129.135|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2015-02-10 23:43:55 ERROR 404: Not Found.
Comment 5 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2015-02-11 04:39:50 UTC
(In reply to Thomas Capricelli from comment #4)
> http://distfiles.gentoo.org/releases/amd64/autobuilds/20141204/stage3-amd64-
> 20141204.tar.bz2%20207889127
> Resolving distfiles.gentoo.org... 216.165.129.135, 64.50.236.52,
> 156.56.247.195, ...
> Connecting to distfiles.gentoo.org|216.165.129.135|:80... connected.
> HTTP request sent, awaiting response... 404 Not Found
> 2015-02-10 23:43:55 ERROR 404: Not Found.

The working URL is http://distfiles.gentoo.org/releases/amd64/autobuilds/20141204/stage3-amd64-20141204.tar.bz2 , but if that's hardcoded, it will stop working soon - we only keep the last 4 successful builds in the mirrors.
The "dangling" "%20207889127" in the URL above seems some sort of "garbage".
Comment 6 Thomas Capricelli 2015-02-11 08:57:42 UTC
(In reply to Jorge Manuel B. S. Vicetto from comment #5)
> The working URL is
> http://distfiles.gentoo.org/releases/amd64/autobuilds/20141204/stage3-amd64-
> 20141204.tar.bz2 , but if that's hardcoded, it will stop working soon - we
> only keep the last 4 successful builds in the mirrors.
> The "dangling" "%20207889127" in the URL above seems some sort of "garbage".

The script does some kind of "ls -lrt |tail", the url is not hardcoded.

My purpose was not to debug the script (yes, the garbage should not be there). Just to point out it does not work 'as is'.
Comment 7 Thomas Capricelli 2015-03-02 17:03:30 UTC
This is far from trivial actually. The "good way" would be of course to have /usr/portage/ (including distfiles) outside of the container. Which is not currently possible from a Dockerfile.

You can use volumes to mount the host /usr/portage in the container (doing "docker run -v .."), but this is not possible from Dockerfile. On purpose for some security reasons.
Comment 8 ChaosEngine 2015-03-02 17:21:02 UTC
Yes, indeed. I'm currently testing and playing with this:

https://github.com/gentoo/gentoo-docker-images

and I have high hopes
Comment 9 Thomas Capricelli 2015-04-08 20:14:52 UTC
I noticed that the current "official" gentoo docker channel
  https://registry.hub.docker.com/repos/gentoo/

contains an image with just the portage tree. And it gets updated, great !

Unfortunately, this can't be used yet from Dockefile. This ticket summarizes what we definitely need, and i post it here for the record:

https://github.com/docker/docker/issues/3156
Comment 10 Thomas Capricelli 2015-04-08 20:27:06 UTC
Another link worth mentionning i think. This guy has already worked on creating a hierarchy of gentoo images. He is the original author of the previously linked docker ticket.

https://github.com/wking/dockerfile

He currently stores the gentoo portage tree in images, so this is not production ready, but the hierarchy idea seems right to me.
Comment 11 ChaosEngine 2015-04-08 20:43:32 UTC
If portage is concerned; why not use publicly available portage snapshots from:

http://distfiles.gentoo.org/releases/snapshots/current/

...or mirrors? They are up to one day old so we can live with that. If user really needs, emerge-webrsync is at hand. Using wget inside a container or Dockerfile seems alright.
Comment 12 Thomas Capricelli 2015-04-08 22:55:30 UTC
(In reply to ChaosEngine from comment #11)
> If portage is concerned; why not use publicly available portage snapshots

You misunderstood. It is not difficult at all to find out a way to get a portage snapshot. The problem is to NOT have the whole gigabytes of it inside a docker image. This is needed only when building the image, but then not.
Comment 13 ChaosEngine 2015-04-08 23:48:04 UTC
(In reply to Thomas Capricelli from comment #12)
> (In reply to ChaosEngine from comment #11)
> > If portage is concerned; why not use publicly available portage snapshots
> 
> You misunderstood. It is not difficult at all to find out a way to get a
> portage snapshot. The problem is to NOT have the whole gigabytes of it
> inside a docker image. This is needed only when building the image, but then
> not.

Are you talking about keeping such built image container up to date? Isn't it any different than any keeping other distros images up to date (# apt-get update; apt-get upgrade)? The argumentation of using "volume containers" for such task is consistent with docker philosopy.

The idea of wking's  hierarchy of gentoo images is also very good. All-linked-together, and all can be using single "portage volume container".
Comment 14 Andreas K. Hüttel archtester gentoo-dev 2020-07-07 12:42:31 UTC
The images are there, they just need to be marked offical. I'll open a separate bug for that. 

https://www.gentoo.org/news/2020/07/04/official-docker.html
Comment 15 Thomas Capricelli 2020-07-08 21:23:37 UTC
Yes, I had noticed the news. Thanks a lot for this !