Change image for catalyst.

This commit is contained in:
Alexis Lahouze 2018-11-25 18:39:43 +01:00
parent e2da9be6df
commit 8d2d96b871

View File

@ -1,24 +1,51 @@
# name the portage image FROM python:3.7-alpine as base
FROM gentoo/portage:latest as portage
# image is based on stage3-amd64 ARG CATALYST_VERSION
FROM gentoo/stage3-amd64:latest as stage3
# copy the entire portage volume in RUN git clone https://anongit.gentoo.org/git/proj/catalyst.git catalyst
COPY --from=portage /usr/portage /usr/portage
ARG MAKEOPTS RUN pip install snakeoil
ARG EMERGE_OPTS=-qv
# Install needed packages WORKDIR catalyst
RUN MAKEOPTS=$MAKEOPTS emerge $EMERGE_OPTS dev-util/catalyst
COPY stage3-preclean-chroot.sh /usr/share/catalyst/targets/stage3/stage3-preclean-chroot.sh RUN python -m setup install
COPY stage4-chroot.sh /usr/share/catalyst/targets/stage4/stage4-chroot.sh
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 /var/lib/catalyst
# Volume for downloaded distfiles
VOLUME /var/cache/portage/distfiles VOLUME /var/cache/portage/distfiles
# Volume for generated packages
VOLUME /var/cache/portage/packages VOLUME /var/cache/portage/packages
# The entrypoint…
COPY entrypoint.sh entrypoint.sh COPY entrypoint.sh entrypoint.sh
# ... to be called
CMD /entrypoint.sh CMD /entrypoint.sh