diff --git a/.gitea/workflows/almalinux8.yaml b/.gitea/workflows/almalinux8.yaml index cb80cbd..1d1ee9b 100644 --- a/.gitea/workflows/almalinux8.yaml +++ b/.gitea/workflows/almalinux8.yaml @@ -29,7 +29,7 @@ jobs: - name: Setup Docker buildx uses: docker/setup-buildx-action@v3 - if: ${{ matrix.flavor == 'default' }} - name: Build and push almalinux base + name: Build and push almalinux base image uses: docker/build-push-action@v5 with: # platforms: linux/amd64,linux/arm64 @@ -39,9 +39,10 @@ jobs: build-args: | ALMALINUX_VERSION=${{ matrix.version }} tags: | - quay.io/teras/almalinux:${{ matrix.version }} - - if: ${{ matrix.flavor == 'micro' }} - name: Build and push almalinux flavor + quay.io/teras/almalinux:${{ matrix.version }} + quay.io/teras/almalinux:8 + - if: ${{ matrix.flavor == 'micro' || matrix.flavor == 'minimal' }} + name: Build and push almalinux flavor image uses: docker/build-push-action@v5 with: # platforms: linux/amd64,linux/arm64 @@ -51,51 +52,5 @@ jobs: build-args: | ALMALINUX_VERSION=${{ matrix.version }} tags: | - quay.io/teras/almalinux:${{ matrix.version }}-${{ matrix.flavor }} - build-latest: - name: Build latest almalinux8 container images - runs-on: ubuntu-latest - needs: - - build - container: - image: ghcr.io/catthehacker/ubuntu:act-latest - steps: - - name: Check out repository code - uses: actions/checkout@v4 - - name: Login to docker.io - uses: docker/login-action@v3 - with: - registry: quay.io - username: ${{ vars.QUAY_USERNAME }} - password: ${{ secrets.QUAY_SECRET }} - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v3 - - name: Setup Docker buildx - uses: docker/setup-buildx-action@v3 - - name: Build and push latest almalinux8-micro - uses: docker/build-push-action@v5 - with: - # platforms: linux/amd64,linux/arm64 - push: true - context: . - file: ./8/Dockerfile.micro - tags: | - quay.io/teras/almalinux:8-micro - - name: Build and push latest almalinux8-minimal - uses: docker/build-push-action@v5 - with: - # platforms: linux/amd64,linux/arm64 - push: true - context: . - file: ./8/Dockerfile.minimal - tags: | - quay.io/teras/almalinux:8-minimal - - name: Build and push latest almalinux8 - uses: docker/build-push-action@v5 - with: - # platforms: linux/amd64,linux/arm64 - push: true - context: . - file: ./8/Dockerfile.default - tags: | - quay.io/teras/almalinux:8 + quay.io/teras/almalinux:${{ matrix.version }}-${{ matrix.flavor }} + quay.io/teras/almalinux:8-${{ matrix.flavor }} diff --git a/.gitea/workflows/almalinux9.yaml b/.gitea/workflows/almalinux9.yaml index 679998d..0c9cbc0 100644 --- a/.gitea/workflows/almalinux9.yaml +++ b/.gitea/workflows/almalinux9.yaml @@ -39,8 +39,10 @@ jobs: build-args: | ALMALINUX_VERSION=${{ matrix.version }} tags: | - quay.io/teras/almalinux:${{ matrix.version }} - - if: ${{ matrix.flavor == 'micro' }} + quay.io/teras/almalinux:${{ matrix.version }} + quay.io/teras/almalinux:9 + quay.io/teras/almalinux:latest + - if: ${{ matrix.flavor == 'micro' || matrix.flavor == 'minimal' }} name: Build and push almalinux uses: docker/build-push-action@v5 with: @@ -51,55 +53,6 @@ jobs: build-args: | ALMALINUX_VERSION=${{ matrix.version }} tags: | - quay.io/teras/almalinux:${{ matrix.version }}-${{ matrix.flavor }} - - build-latest: - name: Build latest almalinux9 container images - runs-on: ubuntu-latest - needs: - - build - container: - image: ghcr.io/catthehacker/ubuntu:act-latest - steps: - - name: Check out repository code - uses: actions/checkout@v4 - - name: Login to docker.io - uses: docker/login-action@v3 - with: - registry: quay.io - username: ${{ vars.QUAY_USERNAME }} - password: ${{ secrets.QUAY_SECRET }} - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v3 - - name: Setup Docker buildx - uses: docker/setup-buildx-action@v3 - - name: Build and push latest almalinux9-micro - uses: docker/build-push-action@v5 - with: - # platforms: linux/amd64,linux/arm64 - push: true - context: . - file: ./9/Dockerfile.micro - tags: | - quay.io/teras/almalinux:9-micro - quay.io/teras/almalinux:micro - - name: Build and push latest almalinux9-minimal - uses: docker/build-push-action@v5 - with: - # platforms: linux/amd64,linux/arm64 - push: true - context: . - file: ./9/Dockerfile.minimal - tags: | - quay.io/teras/almalinux:9-minimal - quay.io/teras/almalinux:minimal - - name: Build and push latest almalinux9 - uses: docker/build-push-action@v5 - with: - # platforms: linux/amd64,linux/arm64 - push: true - context: . - file: ./9/Dockerfile.default - tags: | - quay.io/teras/almalinux:9 - quay.io/teras/almalinux:latest + quay.io/teras/almalinux:${{ matrix.version }}-${{ matrix.flavor }} + quay.io/teras/almalinux:9-${{ matrix.flavor }} + quay.io/teras/almalinux:${{ matrix.flavor }} \ No newline at end of file diff --git a/8/Dockerfile.default b/8/Dockerfile.default index 42214b5..8fdb3af 100644 --- a/8/Dockerfile.default +++ b/8/Dockerfile.default @@ -53,7 +53,7 @@ RUN rm -rf /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/log/yum.* /mnt/rootfs/var/ca touch /mnt/rootfs/etc/resolv.conf; \ touch /mnt/rootfs/etc/hostname -FROM scratch as stage2 +FROM scratch AS stage2 COPY --from=builder /mnt/rootfs/ / diff --git a/8/Dockerfile.minimal b/8/Dockerfile.minimal index f37f0ac..ace5cba 100644 --- a/8/Dockerfile.minimal +++ b/8/Dockerfile.minimal @@ -4,11 +4,8 @@ FROM docker.io/almalinux:${ALMALINUX_VERSION} AS builder RUN mkdir -p /mnt/rootfs; \ dnf -y install \ - almalinux-release \ coreutils-single \ - curl-minimal \ glibc-minimal-langpack \ - libcurl-minimal \ microdnf \ libusbx \ langpacks-en \ @@ -16,48 +13,37 @@ RUN mkdir -p /mnt/rootfs; \ --installroot /mnt/rootfs --releasever 8 --setopt install_weak_deps=false --nodocs; \ dnf --installroot /mnt/rootfs clean all; -# Additional hacks for kickstart file and backward compatable support /mnt/rootfs/var/lib/dnf/history* -RUN rm -rf /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/log/yum.* /mnt/rootfs/usr/share/i18n/charmaps /mnt/rootfs/usr/share/i18n/locales ; \ - rm -rf /mnt/rootfs/var/cache/dnf/* /mnt/rootfs/var/lib/dnf/repos /mnt/rootfs/boot /mnt/rootfs/dev/null ; \ - rm -rf /mnt/rootfs/var/log/hawkey.log /mnt/rootfs/var/log/* ; \ +# Additional hacks for kickstart file and backward compatable support +RUN rm -rf /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/log/yum.* /mnt/rootfs/var/cache/dnf /mnt/rootfs/var/lib/dnf/repos; \ + rm -rf /mnt/rootfs/var/lib/dnf/history* /mnt/rootfs/var/log/hawkey.log /mnt/rootfs/boot /mnt/rootfs/dev/null /mnt/rootfs/run/*; \ mkdir -p /mnt/rootfs/run/lock; \ + # generate build time file for compatibility with CentOS /bin/date +%Y%m%d_%H%M > /mnt/rootfs/etc/BUILDTIME; \ echo '%_install_langs C.utf8' > /mnt/rootfs/etc/rpm/macros.image-language-conf; \ echo 'LANG="C.utf8"' > /mnt/rootfs/etc/locale.conf; \ echo 'container' > /mnt/rootfs/etc/dnf/vars/infra; \ touch /mnt/rootfs/etc/.pwd.lock; \ chmod 600 /mnt/rootfs/etc/.pwd.lock; \ - touch /mnt/rootfs/run/utmp ;\ - chmod 664 /mnt/rootfs/run/utmp ;\ echo '0.000000 1728971976 0.000000' > /mnt/rootfs/etc/adjtime; \ echo '1728971976' >> /mnt/rootfs/etc/adjtime; \ echo 'LOCAL' >> /mnt/rootfs/etc/adjtime; \ - # echo '# This file has been generated by the Anaconda Installer.' > /mnt/rootfs/etc/sysconfig/sshd-permitrootlogin ;\ - # echo '# Allow root to log in using ssh. Remove this file to opt-out.' >> /mnt/rootfs/etc/sysconfig/sshd-permitrootlogin ;\ - # echo 'PERMITROOTLOGIN="-oPermitRootLogin=yes"' >> /mnt/rootfs/etc/sysconfig/sshd-permitrootlogin ;\ + echo '# This file has been generated by the Anaconda Installer.' > /mnt/rootfs/etc/sysconfig/sshd-permitrootlogin ;\ + echo '# Allow root to log in using ssh. Remove this file to opt-out.' >> /mnt/rootfs/etc/sysconfig/sshd-permitrootlogin ;\ + echo 'PERMITROOTLOGIN="-oPermitRootLogin=yes"' >> /mnt/rootfs/etc/sysconfig/sshd-permitrootlogin ;\ echo 'KEYMAP="us"' > /mnt/rootfs/etc/vconsole.conf; \ echo 'FONT="eurlatgr"' >> /mnt/rootfs/etc/vconsole.conf; \ - rm -rf /mnt/rootfs/usr/share/locale/en_US@piglati* /mnt/rootfs/run/blkid /mnt/rootfs/var/cache/dnf/.gpgkeyschecked.yum ; \ + rm -rf /mnt/rootfs/usr/share/locale/en_CA/ /mnt/rootfs/usr/share/locale/en_GB/ /mnt/rootfs/usr/share/locale/en@* /mnt/rootfs/usr/share/locale/en /mnt/rootfs/usr/share/locale/en*@* /mnt/rootfs/usr/share/i18n/charmaps /mnt/rootfs/usr/share/i18n/locales ;\ rm -f /mnt/rootfs/etc/machine-id; \ touch /mnt/rootfs/etc/machine-id; \ touch /mnt/rootfs/etc/resolv.conf; \ - touch /mnt/rootfs/etc/hostname -# AL9 specific hacks -RUN mkdir -p /mnt/rootfs/var/cache/private /mnt/rootfs/var/lib/private /mnt/rootfs/var/lib/systemd/coredump /mnt/rootfs/var/lib/tpm2-tss/system/keystore ;\ - mkdir -p /mnt/rootfs/run/cryptsetup /mnt/rootfs/run/lock/subsys /mnt/rootfs/run/log /mnt/rootfs/run/user /mnt/rootfs/run/tpm2-tss/eventlog ;\ - mkdir -p /mnt/rootfs/run/systemd/ask-password /mnt/rootfs/run/systemd/machines /mnt/rootfs/run/systemd/seats /mnt/rootfs/run/systemd/sessions /mnt/rootfs/run/systemd/shutdown /mnt/rootfs/run/systemd/users ;\ - chmod 700 /mnt/rootfs/var/cache/private ; \ - chmod 700 /mnt/rootfs/var/lib/private ; \ - chmod 700 /mnt/rootfs/run/cryptsetup ; \ - groupadd -R '/mnt/rootfs/' -r -p '!*' -g 996 sgx && groupadd -R '/mnt/rootfs/' -r -p '!*' -g 995 systemd-oom ; \ - useradd -R '/mnt/rootfs/' -r -c 'systemd Userspace OOM Killer' -g 995 -u 995 -s '/usr/sbin/nologin' -M -d '/' systemd-oom ; \ - sed -i "/sgx/d" /mnt/rootfs/etc/group- ; \ - sed -i "/sgx/d" /mnt/rootfs/etc/gshadow- ; \ + touch /mnt/rootfs/etc/hostname; \ cd /mnt/rootfs/etc ; \ - ln -s ../usr/share/zoneinfo/Asia/Jakarta localtime; + ln -s ../usr/share/zoneinfo/Asia/Jakarta localtime FROM scratch +ARG ALMALINUX_VERSION=8.10 + LABEL maintainer="Muhamad Aditya Prima " LABEL name="almalinux" LABEL version="${ALMALINUX_VERSION}" @@ -73,4 +59,4 @@ COPY --from=builder /mnt/rootfs / ENV LANG=C.utf8 -CMD ["/bin/bash"] \ No newline at end of file +CMD ["/bin/sh"] \ No newline at end of file diff --git a/9/Dockerfile.minimal b/9/Dockerfile.minimal index a646477..5514fdb 100644 --- a/9/Dockerfile.minimal +++ b/9/Dockerfile.minimal @@ -5,7 +5,6 @@ FROM docker.io/almalinux:${ALMALINUX_VERSION} AS builder # Install almalinux-release and required dependencies RUN mkdir -p /mnt/rootfs; \ dnf -y install --installroot /mnt/rootfs \ - almalinux-release \ coreutils-single \ curl-minimal \ glibc-minimal-langpack \ @@ -82,4 +81,4 @@ COPY --from=builder /mnt/rootfs / ENV LANG=C.utf8 -CMD ["/bin/bash"] \ No newline at end of file +CMD ["/bin/sh"] \ No newline at end of file