From 2232da2a31843ea00c02b9c7a5494483adcff712 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Fri, 12 Aug 2016 19:00:42 +0200 Subject: [PATCH] Cleanup --- Dockerfile | 9 ++------ README.md | 59 ---------------------------------------------------- bootstrap.sh | 2 +- build.sh | 2 -- 4 files changed, 3 insertions(+), 69 deletions(-) diff --git a/Dockerfile b/Dockerfile index 28030ad..ddfb4d5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,16 @@ -FROM busybox +FROM busybox MAINTAINER Julian Ospald # copy hooks 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 - diff --git a/README.md b/README.md index 48b33a1..e69de29 100644 --- a/README.md +++ b/README.md @@ -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 -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) diff --git a/bootstrap.sh b/bootstrap.sh index f34c6e4..84cd8f7 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -51,5 +51,5 @@ cd / echo "Bootstrapped ${stage3} into /:" ls --color -lah -# exec /bin/bash -c /build.sh +exec /bin/bash -c /build.sh diff --git a/build.sh b/build.sh index 5e64e3e..ab31727 100755 --- a/build.sh +++ b/build.sh @@ -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