From 8d2d96b8713214a6d9b8679b27fd4e12c2222b43 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Sun, 25 Nov 2018 18:39:43 +0100 Subject: [PATCH] Change image for catalyst. --- Dockerfile | 51 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index b67e825..245e334 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,51 @@ -# name the portage image -FROM gentoo/portage:latest as portage +FROM python:3.7-alpine as base -# image is based on stage3-amd64 -FROM gentoo/stage3-amd64:latest as stage3 +ARG CATALYST_VERSION -# copy the entire portage volume in -COPY --from=portage /usr/portage /usr/portage +RUN git clone https://anongit.gentoo.org/git/proj/catalyst.git catalyst -ARG MAKEOPTS -ARG EMERGE_OPTS=-qv +RUN pip install snakeoil -# Install needed packages -RUN MAKEOPTS=$MAKEOPTS emerge $EMERGE_OPTS dev-util/catalyst +WORKDIR catalyst -COPY stage3-preclean-chroot.sh /usr/share/catalyst/targets/stage3/stage3-preclean-chroot.sh -COPY stage4-chroot.sh /usr/share/catalyst/targets/stage4/stage4-chroot.sh +RUN python -m setup install +FROM python:3.7-alpine + + +# Copy snakeoil files +COPY --from=base /usr/lib/python3.7/site-packages/snakeoil \ + /usr/lib/python3.7/site-packages/ + + +# Copy Catalyst library files +COPY --from=base /usr/lib/python3.7/site-packages/catalyst \ + /usr/lib/python3.7/site-packages/ + +# Copy Catalyst shared files +COPY --from=base /usr/share/catalyst /usr/share/ + +# Copy Catalyst configuration files +COPY --from=base /etc/catalyst /etc/ + +# Copy Catalyst binary +COPY --from=base /usr/bin/catalyst /usr/bin/ + +# Override Stage3 preclean to add perl-cleaner invocation +COPY stage3-preclean-chroot.sh \ + /usr/share/catalyst/targets/stage3/stage3-preclean-chroot.sh + +# Volume for catalyst generated files VOLUME /var/lib/catalyst + +# Volume for downloaded distfiles VOLUME /var/cache/portage/distfiles + +# Volume for generated packages VOLUME /var/cache/portage/packages +# The entrypoint… COPY entrypoint.sh entrypoint.sh + +# ... to be called CMD /entrypoint.sh