13 Commits

Author SHA1 Message Date
3fa0090ab7 don't use build cache
Some checks failed
Docker Image CI / build (openrc) (push) Failing after 1m25s
2024-02-17 20:06:46 -05:00
ab1625a02e add back seemingly useless whitespace
Some checks failed
Docker Image CI / build (openrc) (push) Failing after 1m11s
2024-02-17 20:01:33 -05:00
0239c5b2de revert more
Some checks failed
Docker Image CI / build (openrc) (push) Failing after 1m35s
2024-02-15 03:39:18 -05:00
be481798e3 Revert changes
Some checks failed
Docker Image CI / build (openrc) (push) Failing after 1m9s
2024-02-15 03:24:59 -05:00
0af0e488c3 maybe GITHUB_RUN_ID not imlemented?
Some checks failed
Docker Image CI / build (openrc) (push) Failing after 1m7s
2024-02-15 03:16:16 -05:00
5802d1df18 De-complicate sed operation
Some checks failed
Docker Image CI / build (openrc) (push) Failing after 1m5s
2024-02-15 03:01:41 -05:00
3d299997e7 debug Dockerfile
Some checks failed
Docker Image CI / build (openrc) (push) Failing after 1m5s
2024-02-15 02:58:17 -05:00
227e322a36 alright, I give. sed the values into the dockerfile
Some checks failed
Docker Image CI / build (openrc) (push) Failing after 1m5s
2024-02-15 02:46:54 -05:00
fcb4c34b2b let's get creative
All checks were successful
Docker Image CI / build (openrc) (push) Successful in 3m30s
2024-02-15 02:24:20 -05:00
bc09bcff14 "List type is a newline-delimited string"
All checks were successful
Docker Image CI / build (openrc) (push) Successful in 3m33s
2024-02-15 01:53:43 -05:00
27aa056a39 push image pls
All checks were successful
Docker Image CI / build (openrc) (push) Successful in 3m21s
2024-02-15 01:25:12 -05:00
96e4d2d536 test pipeline
All checks were successful
Docker Image CI / build (openrc) (push) Successful in 2m34s
2024-02-15 01:18:58 -05:00
f610178d89 labels, other changes
All checks were successful
Docker Image CI / build (devel) (pull_request) Successful in 2m53s
Docker Image CI / build (dinit) (pull_request) Successful in 2m28s
Docker Image CI / build (openrc) (pull_request) Successful in 2m21s
Docker Image CI / build (runit) (pull_request) Successful in 2m26s
Docker Image CI / build (s6) (pull_request) Successful in 2m19s
set labels, move makefile logic into dockerfile, pr pipeline
2024-02-12 03:30:35 -05:00
2 changed files with 61 additions and 22 deletions

View File

@@ -4,6 +4,8 @@ on:
workflow_dispatch:
branches: [ main ]
push:
branches: [ master, verbose-dockerfile-pipeline-test ]
pull_request:
branches: [ master ]
schedule:
- cron: '0 5 * * 3'
@@ -18,11 +20,7 @@ jobs:
matrix:
images:
[
devel,
openrc,
runit,
s6,
dinit
openrc
]
env:
REGISTRY: gitea.artixlinux.org
@@ -40,21 +38,28 @@ jobs:
uses: https://github.com/actions/checkout@v4
- name: Set up docker
run: curl -fsSL https://get.docker.com | sh
# - name: Define metadata variables
# run: |
# sed -i "s/ARG version=.*/ARG version=$(date +'%Y%m%d').0.${{ gitea.sha }}/" Dockerfile
# sed -i "s/ARG githash=.*/ARG githash=${{ gitea.sha }}/" Dockerfile
# sed -i "s/ARG created=.*/ARG created=$(date -u +'%Y-%m-%dT%H:%M:%S%:z')/" Dockerfile
# cat Dockerfile
- name: Build Docker image
uses: https://github.com/docker/build-push-action@v5
with:
push: false
pull: true
no-cache: true
context: .
build-args: |
img=${{ matrix.images }}
tags: "${{ env.ABSOLUTE_IMAGE }}:base-${{ matrix.images }},${{ env.ABSOLUTE_DH_IMAGE }}:${{ matrix.images }}"
tags: "${{ env.ABSOLUTE_IMAGE }}:base-${{ matrix.images }}-test,${{ env.ABSOLUTE_DH_IMAGE }}:${{ matrix.images }}-test"
- name: Create latest tag
if: matrix.images == 'devel'
uses: https://github.com/docker/build-push-action@v5
with:
push: false
pull: true
pull: false
context: .
build-args: |
img=${{ matrix.images }}
@@ -66,10 +71,10 @@ jobs:
username: ${{ gitea.actor }}
password: ${{ secrets.PAT }}
- name: Push to Gitea
if: gitea.event_name == 'push' || gitea.event_name == 'schedule'
run: docker push "${{ env.ABSOLUTE_IMAGE }}:base-${{ matrix.images }}"
if: ( gitea.event_name == 'push' && github.ref == 'refs/heads/master' ) || gitea.event_name == 'schedule'
run: docker push "${{ env.ABSOLUTE_IMAGE }}:base-${{ matrix.images }}-test"
- name: Push latest tag
if: ( gitea.event_name == 'push' || gitea.event_name == 'schedule' ) && matrix.images == 'devel'
if: ( ( gitea.event_name == 'push' && github.ref == 'refs/heads/master' ) || gitea.event_name == 'schedule' ) && matrix.images == 'devel'
run: docker push "${{ env.ABSOLUTE_IMAGE }}:latest"
- name: Log in to the Docker Hub
uses: https://github.com/docker/login-action@v2
@@ -78,8 +83,8 @@ jobs:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB }}
- name: Push to Docker Hub
if: gitea.event_name == 'push' || gitea.event_name == 'schedule'
run: docker push "${{ env.ABSOLUTE_DH_IMAGE }}:${{ matrix.images }}"
if: ( gitea.event_name == 'push' && github.ref == 'refs/heads/master' ) || gitea.event_name == 'schedule'
run: docker push "${{ env.ABSOLUTE_DH_IMAGE }}:${{ matrix.images }}-test"
- name: Push latest tag
if: ( gitea.event_name == 'push' || gitea.event_name == 'schedule' ) && matrix.images == 'devel'
if: ( ( gitea.event_name == 'push' && github.ref == 'refs/heads/master' ) || gitea.event_name == 'schedule' ) && matrix.images == 'devel'
run: docker push "${{ env.ABSOLUTE_DH_IMAGE }}:latest"

View File

@@ -6,20 +6,54 @@ WORKDIR /usr/artixlinux-docker
COPY . .
FROM base as build
WORKDIR /usr/artixlinux-docker
ARG img=devel
RUN make "dockerfile-base-${img}"
WORKDIR /usr/artixlinux-docker/output
RUN ROOTFS=base-${img}.tar.zst && \
sha256sum -c base-${img}.tar.zst.SHA256 && \
ARG img=base-devel
ENV working=/usr/artixlinux-docker
ENV BUILDDIR=${working}/build
ENV OUTPUTDIR=${working}/output
WORKDIR ${working}
RUN mkdir -vp ${BUILDDIR}/alpm-hooks/usr/share/libalpm/hooks && \
find /usr/share/libalpm/hooks -exec ln -sf /dev/null ${BUILDDIR}/alpm-hooks{} \; && \
mkdir -vp ${BUILDDIR}/var/lib/pacman/ ${OUTPUTDIR} && \
install -Dm644 /usr/share/artools/pacman.conf.d/galaxy-x86_64.conf ${BUILDDIR}/etc/pacman.conf && \
cat pacman-conf.d-noextract.conf >> ${BUILDDIR}/etc/pacman.conf && \
fakechroot fakeroot pacman -Sy -r ${BUILDDIR} --noconfirm --dbpath ${BUILDDIR}/var/lib/pacman --config ${BUILDDIR}/etc/pacman.conf --noscriptlet --hookdir ${BUILDDIR}/alpm-hooks/usr/share/libalpm/hooks/ ${img} && \
rsync -rt --backup --suffix=.pacnew rootfs/* ${BUILDDIR}/ && \
fakechroot fakeroot chroot ${BUILDDIR} update-ca-trust && \
fakechroot fakeroot chroot ${BUILDDIR} sh -c 'pacman-key --init && pacman-key --populate && rm -rf etc/pacman.d/gnupg/{openpgp-revocs.d/,private-keys-v1.d/,pubring.gpg~,gnupg.S.}*' && \
ln -fs /usr/lib/os-release ${BUILDDIR}/etc/os-release && \
sed -i -e 's/^root::/root:!:/' "${BUILDDIR}/etc/shadow" && \
fakeroot tar --numeric-owner --xattrs --acls --exclude-from=exclude -C ${BUILDDIR} -c . -f ${OUTPUTDIR}/${img}.tar
WORKDIR ${OUTPUTDIR}
RUN zstd --long -T0 -8 ${img}.tar; sha256sum ${img}.tar.zst > ${img}.tar.zst.SHA256
WORKDIR ${OUTPUTDIR}
RUN ROOTFS=${img}.tar.zst && \
sha256sum -c ${img}.tar.zst.SHA256 && \
mkdir /rootfs && \
tar -C /rootfs --extract --file "${ROOTFS}"
FROM scratch AS root
ARG img=base-devel
ARG version=VERSION
ARG githash=REVISION
ARG created=CREATED
LABEL org.opencontainers.image.title="Artix Linux ${img} Image"
LABEL org.opencontainers.image.description="Official containerd image of Artix Linux, a fork of Arch Linux that respects init freedom."
LABEL org.opencontainers.image.vendor="Artix Linux"
LABEL org.opencontainers.image.authors="Cory Sanin <corysanin@artixlinux.org>, artoo <artoo@artixlinux.org>, Chris Cromer <cromer@artixlinux.org>"
LABEL org.opencontainers.image.url="https://gitea.artixlinux.org/artixdocker"
LABEL org.opencontainers.image.documentation="https://wiki.artixlinux.org/"
LABEL org.opencontainers.image.source="https://gitea.artixlinux.org/artixdocker/artixlinux-docker"
LABEL org.opencontainers.image.licenses="GPL-3.0-or-later"
LABEL org.opencontainers.image.version="${version}"
LABEL org.opencontainers.image.revision="${githash}"
LABEL org.opencontainers.image.created="${created}"
COPY --from=build /rootfs/ /
RUN ldconfig && \
sed -i '/BUILD_ID/a VERSION_ID=TEMPLATE_VERSION_ID' /etc/os-release
sed -i "/BUILD_ID/a VERSION_ID=${version}" /etc/os-release
ENV LANG=C.UTF-8
CMD ["/usr/bin/bash"]