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 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