-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
51 lines (38 loc) · 1.92 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM gentoo/stage3-amd64:latest
LABEL maintainer="mudler <mudler@sabayonlinux.org>"
# Set locales to en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV FEATURES="-sandbox -usersandbox -userpriv"
RUN echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen
RUN locale-gen || true
# Initialize repos.conf/gentoo.conf to avoid installation
# of portage under /var/db/repos/gentoo
ADD ./script/gentoo-configuration.sh /
RUN /bin/bash /gentoo-configuration.sh && rm -rf /gentoo-configuration.sh
# Upgrading portage and installing necessary packages
RUN rm -rf '/usr/portage/metadata/timestamp.chk' && \
emerge-webrsync
# Configure the sabayon box, installing equo setting up locales
ADD ./script/sabayon-configuration.sh /
RUN /bin/bash /sabayon-configuration.sh && rm -rf /sabayon-configuration.sh
# Generating empty equo db
ADD ./script/generate-equo-db.sh /
ADD ./ext/equo.sql /
RUN /bin/bash /generate-equo-db.sh && rm -rf /equo.sql /generate-equo-db.sh
# Calling equo rescue generate, unfortunately we have to use expect
ADD ./script/equo-rescue-generate.exp /
RUN /usr/bin/expect /equo-rescue-generate.exp && rm -rf /equo-rescue-generate.exp
# Portage configurations
ADD ./script/sabayon-configuration-build.sh /sabayon-configuration-build.sh
RUN /bin/bash /sabayon-configuration-build.sh && rm -rf /sabayon-configuration-build.sh
# Perform before-upgrade tasks (mirror sorting, updating repository db, removing portage and keeping profiles and metadata)
RUN mv /etc/entropy/repositories.conf.d/entropy_sabayonlinux.org.example /etc/entropy/repositories.conf.d/entropy_sabayonlinux.org && equo up && equo repo mirrorsort sabayonlinux.org && cd /usr/portage/;ls | grep -v 'profiles' | grep -v 'metadata' | xargs rm -rf
# Cleanup and applying configs
ADD ./script/post-update.sh /post-update.sh
RUN /bin/bash /post-update.sh && rm -rf /post-update.sh
# Set environment variables.
ENV HOME /root
# Define working directory.
WORKDIR /root
# Define default command.
CMD ["bash"]