This commit is contained in:
Julian Ospald 2016-08-12 19:00:42 +02:00
parent ba5e6216ed
commit 2232da2a31
4 changed files with 3 additions and 69 deletions

View File

@ -5,16 +5,12 @@ MAINTAINER Julian Ospald <hasufell@posteo.de>
COPY ./config/paludis /etc/paludis-new
# This one should be present by running the build.sh script
COPY bootstrap.sh /
COPY bootstrap.sh build.sh /
# one step, to make the layer as thin as possible
# bootstrap.h calls build.sh
RUN /bootstrap.sh amd64 x86_64
COPY build.sh /
RUN /build.sh
# update etc files... hope this doesn't screw up
RUN eclectic config accept-all
@ -22,4 +18,3 @@ RUN eclectic config accept-all
# all images deriving from this one have the same state
RUN sed -i -e 's|^sync|#sync|' /etc/paludis/repositories/*.conf

View File

@ -1,59 +0,0 @@
## Usage
This image is optimized for size, as such, stuff in the following
directories is removed:
```
/srv/binhost/
/usr/include/
/usr/lib64/debug/
/usr/portage/
/usr/share/applications/
/usr/share/doc/
/usr/share/gtk-doc/
/usr/share/info/
/usr/share/man/
/usr/share/mime/
/var/cache/paludis/metadata/
/var/cache/paludis/names/
/var/tmp/paludis/
```
When installing something, the hook in `ebuild_preinst_pre/cleanup_files.bash`
will remove files from the following directories from the package before
it is merged:
```
/usr/include/
/usr/lib64/debug/
/usr/share/applications/
/usr/share/doc/
/usr/share/gtk-doc/
/usr/share/info/
/usr/share/man/
/usr/share/mime/
```
When creating a derived image, you have to do the following before
you can attempt package installation, since the checked out files
of the main gentoo repositories are removed, while the git repository
data is still intact:
```sh
git -C /usr/portage checkout -- .
cave sync gentoo
```
A complete Dockerfile command to install something could look like this:
```
RUN chgrp paludisbuild /dev/tty && \
git -C /usr/portage checkout -- . && \
env-update && \
source /etc/profile && \
cave sync && \
cave resolve <the-package-I-want> -x && \
rm -rf /var/cache/paludis/names/* /var/cache/paludis/metadata/* \
/var/tmp/paludis/* /usr/portage/* /srv/binhost/*
```
A few things to note are also:
* non-binary packages are not allowed, since /usr/include/ files are removed and compilation would probably fail hard (a complete rebuild via `cave resolve -e world -x` would be necessary after removing the `ebuild_preinst_pre/cleanup_files.bash` hook)
* the same goes for Dockerfiles that do local compilations, they will have to run `cave resolve -e world -x` in order to restore all development files
* a regular sync does not update the actual repositories, so we have a defined state (files in `/etc/paludis/repositories/*.conf` can be modified to allow that though)

View File

@ -51,5 +51,5 @@ cd /
echo "Bootstrapped ${stage3} into /:"
ls --color -lah
# exec /bin/bash -c /build.sh
exec /bin/bash -c /build.sh

View File

@ -21,8 +21,6 @@ localedef -i en_US -f UTF-8 en_US.utf8
echo LANG="en_US.UTF-8" > /etc/env.d/99locale
# update
sed -i -e 's#^SCM_REPOSITORY=.*$#SCM_REPOSITORY="https://galileo.mailstation.de/gerrit/paludis"#' \
/var/db/paludis/repositories/arbor/packages/sys-apps/paludis/paludis-scm.exheres-0
chgrp paludisbuild /dev/tty
cave sync
cave resolve -z -1 dev-libs/libressl sys-apps/paludis -U dev-libs/openssl -D dev-libs/openssl -f -x