gentoo-builder/Dockerfile

66 lines
1.7 KiB
Docker

FROM python:3.6-alpine as base
RUN apk add --no-cache --virtual .build-deps \
git make gcc musl-dev asciidoc \
\
# Install deps
&& pip install snakeoil \
&& pip install git+https://github.com/dol-sen/pyDeComp \
\
# Clone catalyst repository
&& git clone https://anongit.gentoo.org/git/proj/catalyst.git catalyst \
\
# Build and install catalyst
&& cd /catalyst \
&& make \
&& python -m setup install \
\
# Get shash
cd / \
&& wget ftp://mcrypt.hellug.gr/pub/mcrypt/shash/shash-0.2.6.tar.gz \
&& tar xvzf shash-0.2.6.tar.gz \
&& cd shash-0.2.6 && make && make install \
\
# Cleanup
&& cd / \
&& rm -Rf catalyst \
&& apk del .build-deps
FROM python:3.6-alpin as base
RUN apk add coreutils
COPY --from=base /usr/local/lib/python3.6/site-packages/snakeoil \
/usr/local/lib/python3.6/site-packages/
COPY --from=base /usr/local/lib/python3.6/site-packages/DeComp \
/usr/local/lib/python3.6/site-packages/
COPY --from=base /usr/local/bin/shash /usr/local/bin/shash
COPY --from=base /usr/local/lib/python3.6/site-packages/catalyst \
/usr/local/lib/python3.6/site-packages/
COPY --from=base /usr/share/catalyst /usr/share
COPY --from=base /etc/catalyst /etc/
# 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