Compare commits

..

No commits in common. "master" and "alpine" have entirely different histories.

2 changed files with 47 additions and 52 deletions

View File

@ -44,32 +44,32 @@ jobs:
# image-ref: 'quay.io/sindigilive/nginx:${{ matrix.version }}-almalinux' # image-ref: 'quay.io/sindigilive/nginx:${{ matrix.version }}-almalinux'
# format: 'sarif' # format: 'sarif'
# output: 'trivy-results.sarif' # output: 'trivy-results.sarif'
# build-latest: build-latest:
# name: Build latest nginx almalinux based container images name: Build latest nginx almalinux based container images
# runs-on: ubuntu-latest runs-on: ubuntu-latest
# needs: needs:
# - build - build
# container: container:
# image: ghcr.io/catthehacker/ubuntu:act-latest image: ghcr.io/catthehacker/ubuntu:act-latest
# steps: steps:
# - name: Check out repository code - name: Check out repository code
# uses: actions/checkout@v4 uses: actions/checkout@v4
# - name: Login to quay.io - name: Login to quay.io
# uses: docker/login-action@v3 uses: docker/login-action@v3
# with: with:
# registry: quay.io registry: quay.io
# username: ${{ vars.QUAY_USERNAME }} username: ${{ vars.QUAY_USERNAME }}
# password: ${{ secrets.QUAY_SECRET }} password: ${{ secrets.QUAY_SECRET }}
# # - name: Set up QEMU # - name: Set up QEMU
# # uses: docker/setup-qemu-action@v3 # uses: docker/setup-qemu-action@v3
# - name: Setup Docker buildx - name: Setup Docker buildx
# uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
# - name: Build and push latest nginx - name: Build and push latest nginx
# uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
# with: with:
# # platforms: linux/amd64,linux/arm64 # platforms: linux/amd64,linux/arm64
# push: true push: true
# context: . context: .
# file: Dockerfile.almalinux file: Dockerfile.almalinux
# tags: | tags: |
# quay.io/sindigilive/nginx:almalinux quay.io/sindigilive/nginx:almalinux

View File

@ -1,28 +1,24 @@
ARG OS_VERSION=9.5 ARG ALMALINUX_VERSION=9.5
FROM quay.io/sindigilive/almalinux:${OS_VERSION} AS builder FROM quay.io/sindigilive/almalinux:${ALMALINUX_VERSION} AS builder
ARG NGINX_VERSION=1.24 ARG NGINX_VERSION=1.24
ENV ROOTFS=/mnt/rootfs RUN mkdir -p /mnt/rootfs; \
dnf install --installroot /mnt/rootfs \
RUN mkdir -p ${ROOTFS}; \
dnf install --installroot ${ROOTFS} \
coreutils-single \ coreutils-single \
glibc-minimal-langpack \ glibc-minimal-langpack \
--releasever 9 --setopt install_weak_deps=false --nodocs --nogpgcheck -y; \ --releasever 9 --setopt install_weak_deps=false --nodocs -y; \
dnf module reset nginx ; \ dnf module reset nginx ; \
dnf module enable nginx:${NGINX_VERSION} ; \ dnf module enable nginx:${NGINX_VERSION} ; \
dnf install --installroot ${ROOTFS} \ dnf install --installroot /mnt/rootfs \
nginx \ nginx \
--releasever 9 --setopt install_weak_deps=false --nodocs --nogpgcheck -y; \ --releasever 9 --setopt install_weak_deps=false --nodocs -y; \
dnf --installroot ${ROOTFS} clean all; dnf --installroot /mnt/rootfs clean all;
FROM quay.io/sindigilive/almalinux:${OS_VERSION}-micro AS stage2 FROM quay.io/sindigilive/almalinux:${ALMALINUX_VERSION}-micro AS stage2
ENV DIR_DEPS="/var/run/nginx /var/log/nginx /var/lib/nginx/tmp /var/cache/nginx" 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 htdocs /app/htdocs
ADD scripts/entrypoint.sh /usr/local/bin/ ADD scripts/entrypoint.sh /usr/local/bin/
@ -35,18 +31,17 @@ RUN echo "nginx:x:10001:" >> /etc/group ; \
chmod +x /usr/local/bin/entrypoint.sh chmod +x /usr/local/bin/entrypoint.sh
COPY --from=builder \ COPY --from=builder \
${SRC}/libcrypt.so.2 ${SRC}/libpcre.so.1 ${SRC}/libssl.so.3 \ /usr/lib64/libc* \
${SRC}/libcrypto.so.3 ${SRC}/libz.so.1 \ /usr/lib64/libcrypt* \
# /usr/lib64/libcrypt* \ /usr/lib64/libcrypto* \
# /usr/lib64/libcrypto* \ /usr/lib64/libpcre* \
# /usr/lib64/libpcre* \ /usr/lib64/libssl* \
# /usr/lib64/libssl* \ /usr/lib64/libz* \
# /usr/lib64/libz* \
/usr/lib64/ /usr/lib64/
COPY --from=builder ${ROOTFS}/etc/nginx /etc/nginx COPY --from=builder /mnt/rootfs/etc/nginx /etc/nginx
COPY --from=builder ${ROOTFS}/usr/lib64/nginx /usr/lib64/nginx COPY --from=builder /mnt/rootfs/usr/lib64/nginx /usr/lib64/nginx
COPY --from=builder ${ROOTFS}/usr/sbin/nginx /usr/sbin/nginx COPY --from=builder /mnt/rootfs/usr/sbin/nginx /usr/sbin/nginx
ADD etc/nginx /etc/nginx ADD etc/nginx /etc/nginx