Implement CI/CD workflow with GitHub Actions: - to build, test and push container images to Client Library. - to publish images to the Docker Official Library. Add documentation: README.md
70 lines
3.3 KiB
Plaintext
70 lines
3.3 KiB
Plaintext
ARG SYSBASE=almalinux:9
|
|
FROM ${SYSBASE} as system-build
|
|
|
|
RUN mkdir /mnt/sys-root; \
|
|
dnf install -y \
|
|
--installroot /mnt/sys-root \
|
|
--releasever 9 \
|
|
--setopt install_weak_deps=false \
|
|
--nodocs \
|
|
almalinux-release \
|
|
bash \
|
|
coreutils-single \
|
|
curl-minimal \
|
|
glibc-minimal-langpack \
|
|
libcurl-minimal \
|
|
libusbx \
|
|
microdnf \
|
|
rootfiles \
|
|
; \
|
|
echo '%_install_langs en_US.UTF-8' > /etc/rpm/macros.image-language-conf ;\
|
|
dnf reinstall -y \
|
|
--installroot /mnt/sys-root \
|
|
--releasever 9 \
|
|
--setopt install_weak_deps=false \
|
|
--nodocs \
|
|
krb5-libs ; \
|
|
dnf --installroot /mnt/sys-root clean all;
|
|
# Additional hacks for kickstart file and backward compatable support
|
|
RUN rm -rf /mnt/sys-root/var/log/dnf* /mnt/sys-root/var/log/yum.* /mnt/sys-root/var/cache/dnf /mnt/sys-root/var/lib/dnf/repos; \
|
|
rm -rf /mnt/sys-root/var/lib/dnf/history* /mnt/sys-root/var/log/hawkey.log /mnt/sys-root/boot /mnt/sys-root/dev/null /mnt/sys-root/run/*; \
|
|
mkdir -p /mnt/sys-root/run/lock; \
|
|
# generate build time file for compatibility with CentOS
|
|
/bin/date +%Y%m%d_%H%M > /mnt/sys-root/etc/BUILDTIME; \
|
|
echo '%_install_langs C.utf8' > /mnt/sys-root/etc/rpm/macros.image-language-conf; \
|
|
echo 'LANG="C.utf8"' > /mnt/sys-root/etc/locale.conf; \
|
|
echo 'container' > /mnt/sys-root/etc/dnf/vars/infra; \
|
|
touch /mnt/sys-root/etc/.pwd.lock; \
|
|
chmod 600 /mnt/sys-root/etc/.pwd.lock; \
|
|
echo '0.0 0 0.0' > /mnt/sys-root/etc/adjtime; \
|
|
echo '0' >> /mnt/sys-root/etc/adjtime; \
|
|
echo 'UTC' >> /mnt/sys-root/etc/adjtime; \
|
|
echo '# This file has been generated by the Anaconda Installer.' > /mnt/sys-root/etc/sysconfig/sshd-permitrootlogin ;\
|
|
echo '# Allow root to log in using ssh. Remove this file to opt-out.' >> /mnt/sys-root/etc/sysconfig/sshd-permitrootlogin ;\
|
|
echo 'PERMITROOTLOGIN="-oPermitRootLogin=yes"' >> /mnt/sys-root/etc/sysconfig/sshd-permitrootlogin ;\
|
|
echo 'KEYMAP="us"' > /mnt/sys-root/etc/vconsole.conf; \
|
|
echo 'FONT="eurlatgr"' >> /mnt/sys-root/etc/vconsole.conf; \
|
|
# /mnt/sys-root/usr/share/locale/en@* /mnt/sys-root/usr/share/locale/en /mnt/sys-root/usr/share/locale/en*@*
|
|
rm -rf /mnt/sys-root/usr/share/locale/en_CA/ /mnt/sys-root/usr/share/locale/en_GB/ /mnt/sys-root/usr/share/i18n/charmaps /mnt/sys-root/usr/share/i18n/locales ;\
|
|
rm -f /mnt/sys-root/etc/machine-id; \
|
|
touch /mnt/sys-root/etc/machine-id; \
|
|
touch /mnt/sys-root/etc/resolv.conf; \
|
|
touch /mnt/sys-root/etc/hostname; \
|
|
mkdir -p /mnt/sys-root/var/cache/private /mnt/sys-root/var/lib/private /mnt/sys-root/var/lib/systemd/coredump ;\
|
|
chmod 700 /mnt/sys-root/var/cache/private ; \
|
|
chmod 700 /mnt/sys-root/var/lib/private ; \
|
|
groupadd -R '/mnt/sys-root/' -r -p '!*' -g 996 sgx && groupadd -R '/mnt/sys-root/' -r -p '!*' -g 995 systemd-oom ; \
|
|
useradd -R '/mnt/sys-root/' -r -c 'systemd Userspace OOM Killer' -g 995 -u 995 -s '/usr/sbin/nologin' -M -d '/' systemd-oom ; \
|
|
sed -i "/sgx/d" /mnt/sys-root/etc/group- ; \
|
|
sed -i "/sgx/d" /mnt/sys-root/etc/gshadow- ; \
|
|
cd /mnt/sys-root/etc ; \
|
|
ln -s ../usr/share/zoneinfo/UTC localtime ; \
|
|
cd /mnt/sys-root/etc/systemd/system ; \
|
|
ln -s /usr/lib/systemd/system/multi-user.target default.target
|
|
|
|
# Almalinux minimal build
|
|
FROM scratch
|
|
COPY --from=system-build /mnt/sys-root/ /
|
|
|
|
CMD ["/bin/bash"]
|