gentoo / gentoo-docker-images

[MIRROR] Common effort to get an official and automated gentoo base docker container
https://gitweb.gentoo.org/proj/docker-images.git
GNU General Public License v2.0
322 stars 89 forks source link
hacktoberfest

Gentoo Docker Images

build

A collection of Dockerfiles for generating Gentoo docker images.

These images are intended to be created automatically by a cron job and pushed to docker hub. This repository include basic stage3 images and an image usable as a /var/db/repos/gentoo volume

DockerHub

https://hub.docker.com/u/gentoo/

Inventory

The following targets are built and pushed to Docker Hub:

The following upstream stage3 targets are not built at all:

[deprecated]: Deprecated stage3 target

[selinux]: SELinux doesn't seem to make sense inside containers

[under testing]: Not ready for container. Our arch team is working on testing it

[unsupported]: Unsupported Docker architecture

Building the containers

The containers are created using a multi-stage build, which requires Docker >= 19.03.0. The container being built is defined by the TARGET environment variable:

TARGET=stage3-amd64-openrc ./build.sh

Using the portage container as a data volume

docker create -v /var/db/repos/gentoo --name myportagesnapshot gentoo/portage:latest /bin/true
docker run --interactive --tty --volumes-from myportagesnapshot gentoo/stage3:latest /bin/bash

Using the portage container in a multi-stage build

docker-17.05.0 or later supports multi-stage builds, allowing the portage volume to be used when creating images based on a stage3 image.

Example Dockerfile

# name the portage image
FROM gentoo/portage:latest as portage

# based on stage3 image
FROM gentoo/stage3:latest

# copy the entire portage volume in
COPY --from=portage /var/db/repos/gentoo /var/db/repos/gentoo

# continue with image build ...
RUN emerge -qv www-servers/apache # or whichever packages you need

Contributing

We'd love to hear any ideas. Feel free to contact us via any of the following methods:

Policy