gentoo-builder/Dockerfile

66 lines
1.7 KiB
Docker
Raw Normal View History

2018-11-25 21:13:44 +01:00
FROM python:3.6-alpine as base
2018-11-25 18:39:43 +01:00
2018-11-25 19:00:21 +01:00
RUN apk add --no-cache --virtual .build-deps \
2018-11-25 20:03:02 +01:00
git make gcc musl-dev asciidoc \
2018-11-25 20:04:42 +01:00
\
2018-11-25 19:58:37 +01:00
# Install deps
2018-11-25 19:00:21 +01:00
&& pip install snakeoil \
2018-11-25 21:16:32 +01:00
&& pip install git+https://github.com/dol-sen/pyDeComp \
2018-11-25 20:04:42 +01:00
\
2018-11-25 19:58:37 +01:00
# Clone catalyst repository
&& git clone https://anongit.gentoo.org/git/proj/catalyst.git catalyst \
2018-11-25 20:04:42 +01:00
\
2018-11-25 19:58:37 +01:00
# Build and install catalyst
2018-11-25 21:13:44 +01:00
&& cd /catalyst \
2018-11-25 19:58:37 +01:00
&& make \
&& python -m setup install \
2018-11-25 20:04:42 +01:00
\
2018-11-25 21:13:44 +01:00
# 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 \
\
2018-11-25 19:58:37 +01:00
# Cleanup
2018-11-25 21:13:44 +01:00
&& cd / \
2018-11-25 20:03:18 +01:00
&& rm -Rf catalyst \
2018-11-25 19:58:37 +01:00
&& apk del .build-deps
2018-11-25 18:39:43 +01:00
2018-11-25 21:13:44 +01:00
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/
2018-11-25 21:16:32 +01:00
COPY --from=base /usr/local/lib/python3.6/site-packages/DeComp \
/usr/local/lib/python3.6/site-packages/
2018-11-25 21:13:44 +01:00
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/
2018-11-25 20:29:34 +01:00
2018-11-25 18:39:43 +01:00
# 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
2018-11-04 03:49:15 +01:00
VOLUME /var/lib/catalyst
2018-11-25 18:39:43 +01:00
# Volume for downloaded distfiles
2018-11-04 03:49:15 +01:00
VOLUME /var/cache/portage/distfiles
2018-11-25 18:39:43 +01:00
# Volume for generated packages
2018-11-04 03:49:15 +01:00
VOLUME /var/cache/portage/packages
2018-11-25 18:39:43 +01:00
# The entrypoint…
2018-11-04 03:49:15 +01:00
COPY entrypoint.sh entrypoint.sh
2018-11-25 18:39:43 +01:00
# ... to be called
2018-11-04 03:49:15 +01:00
CMD /entrypoint.sh