diff --git a/.gitea/workflows/almalinux.yaml b/.gitea/workflows/almalinux.yaml index bb44514..06ebf79 100644 --- a/.gitea/workflows/almalinux.yaml +++ b/.gitea/workflows/almalinux.yaml @@ -44,32 +44,32 @@ jobs: # image-ref: 'quay.io/sindigilive/nginx:${{ matrix.version }}-almalinux' # format: 'sarif' # output: 'trivy-results.sarif' - build-latest: - name: Build latest nginx almalinux based 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 quay.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 nginx - uses: docker/build-push-action@v5 - with: - # platforms: linux/amd64,linux/arm64 - push: true - context: . - file: Dockerfile.almalinux - tags: | - quay.io/sindigilive/nginx:almalinux + # build-latest: + # name: Build latest nginx almalinux based 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 quay.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 nginx + # uses: docker/build-push-action@v5 + # with: + # # platforms: linux/amd64,linux/arm64 + # push: true + # context: . + # file: Dockerfile.almalinux + # tags: | + # quay.io/sindigilive/nginx:almalinux diff --git a/Dockerfile.almalinux b/Dockerfile.almalinux index fd5b256..9e477c8 100644 --- a/Dockerfile.almalinux +++ b/Dockerfile.almalinux @@ -1,24 +1,28 @@ -ARG ALMALINUX_VERSION=9.5 +ARG OS_VERSION=9.5 -FROM quay.io/sindigilive/almalinux:${ALMALINUX_VERSION} AS builder +FROM quay.io/sindigilive/almalinux:${OS_VERSION} AS builder ARG NGINX_VERSION=1.24 -RUN mkdir -p /mnt/rootfs; \ - dnf install --installroot /mnt/rootfs \ +ENV ROOTFS=/mnt/rootfs + +RUN mkdir -p ${ROOTFS}; \ + dnf install --installroot ${ROOTFS} \ coreutils-single \ glibc-minimal-langpack \ - --releasever 9 --setopt install_weak_deps=false --nodocs -y; \ + --releasever 9 --setopt install_weak_deps=false --nodocs --nogpgcheck -y; \ dnf module reset nginx ; \ dnf module enable nginx:${NGINX_VERSION} ; \ - dnf install --installroot /mnt/rootfs \ + dnf install --installroot ${ROOTFS} \ nginx \ - --releasever 9 --setopt install_weak_deps=false --nodocs -y; \ - dnf --installroot /mnt/rootfs clean all; + --releasever 9 --setopt install_weak_deps=false --nodocs --nogpgcheck -y; \ + dnf --installroot ${ROOTFS} clean all; -FROM quay.io/sindigilive/almalinux:${ALMALINUX_VERSION}-micro AS stage2 +FROM quay.io/sindigilive/almalinux:${OS_VERSION}-micro AS stage2 ENV DIR_DEPS="/var/run/nginx /var/log/nginx /var/lib/nginx/tmp /var/cache/nginx" +ENV ROOTFS=/mnt/rootfs +ENV SRC=${ROOTFS}/usr/lib64 ADD htdocs /app/htdocs ADD scripts/entrypoint.sh /usr/local/bin/ @@ -31,17 +35,18 @@ RUN echo "nginx:x:10001:" >> /etc/group ; \ chmod +x /usr/local/bin/entrypoint.sh COPY --from=builder \ - /usr/lib64/libc* \ - /usr/lib64/libcrypt* \ - /usr/lib64/libcrypto* \ - /usr/lib64/libpcre* \ - /usr/lib64/libssl* \ - /usr/lib64/libz* \ + ${SRC}/libcrypt.so.2 ${SRC}/libpcre.so.1 ${SRC}/libssl.so.3 \ + ${SRC}/libcrypto.so.3 ${SRC}/libz.so.1 \ + # /usr/lib64/libcrypt* \ + # /usr/lib64/libcrypto* \ + # /usr/lib64/libpcre* \ + # /usr/lib64/libssl* \ + # /usr/lib64/libz* \ /usr/lib64/ -COPY --from=builder /mnt/rootfs/etc/nginx /etc/nginx -COPY --from=builder /mnt/rootfs/usr/lib64/nginx /usr/lib64/nginx -COPY --from=builder /mnt/rootfs/usr/sbin/nginx /usr/sbin/nginx +COPY --from=builder ${ROOTFS}/etc/nginx /etc/nginx +COPY --from=builder ${ROOTFS}/usr/lib64/nginx /usr/lib64/nginx +COPY --from=builder ${ROOTFS}/usr/sbin/nginx /usr/sbin/nginx ADD etc/nginx /etc/nginx