Compare commits
13 Commits
master
...
verbose-do
Author | SHA1 | Date | |
---|---|---|---|
3fa0090ab7 | |||
ab1625a02e | |||
0239c5b2de | |||
be481798e3 | |||
0af0e488c3 | |||
5802d1df18 | |||
3d299997e7 | |||
227e322a36 | |||
fcb4c34b2b | |||
bc09bcff14 | |||
27aa056a39 | |||
96e4d2d536 | |||
f610178d89
|
@@ -4,6 +4,8 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
push:
|
push:
|
||||||
|
branches: [ master, verbose-dockerfile-pipeline-test ]
|
||||||
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 5 * * 3'
|
- cron: '0 5 * * 3'
|
||||||
@@ -18,11 +20,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
images:
|
images:
|
||||||
[
|
[
|
||||||
devel,
|
openrc
|
||||||
openrc,
|
|
||||||
runit,
|
|
||||||
s6,
|
|
||||||
dinit
|
|
||||||
]
|
]
|
||||||
env:
|
env:
|
||||||
REGISTRY: gitea.artixlinux.org
|
REGISTRY: gitea.artixlinux.org
|
||||||
@@ -40,21 +38,28 @@ jobs:
|
|||||||
uses: https://github.com/actions/checkout@v4
|
uses: https://github.com/actions/checkout@v4
|
||||||
- name: Set up docker
|
- name: Set up docker
|
||||||
run: curl -fsSL https://get.docker.com | sh
|
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
|
- name: Build Docker image
|
||||||
uses: https://github.com/docker/build-push-action@v5
|
uses: https://github.com/docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
push: false
|
push: false
|
||||||
pull: true
|
pull: true
|
||||||
|
no-cache: true
|
||||||
context: .
|
context: .
|
||||||
build-args: |
|
build-args: |
|
||||||
img=${{ matrix.images }}
|
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
|
- name: Create latest tag
|
||||||
if: matrix.images == 'devel'
|
if: matrix.images == 'devel'
|
||||||
uses: https://github.com/docker/build-push-action@v5
|
uses: https://github.com/docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
push: false
|
push: false
|
||||||
pull: true
|
pull: false
|
||||||
context: .
|
context: .
|
||||||
build-args: |
|
build-args: |
|
||||||
img=${{ matrix.images }}
|
img=${{ matrix.images }}
|
||||||
@@ -66,10 +71,10 @@ jobs:
|
|||||||
username: ${{ gitea.actor }}
|
username: ${{ gitea.actor }}
|
||||||
password: ${{ secrets.PAT }}
|
password: ${{ secrets.PAT }}
|
||||||
- name: Push to Gitea
|
- name: Push to Gitea
|
||||||
if: gitea.event_name == 'push' || gitea.event_name == 'schedule'
|
if: ( gitea.event_name == 'push' && github.ref == 'refs/heads/master' ) || gitea.event_name == 'schedule'
|
||||||
run: docker push "${{ env.ABSOLUTE_IMAGE }}:base-${{ matrix.images }}"
|
run: docker push "${{ env.ABSOLUTE_IMAGE }}:base-${{ matrix.images }}-test"
|
||||||
- name: Push latest tag
|
- 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"
|
run: docker push "${{ env.ABSOLUTE_IMAGE }}:latest"
|
||||||
- name: Log in to the Docker Hub
|
- name: Log in to the Docker Hub
|
||||||
uses: https://github.com/docker/login-action@v2
|
uses: https://github.com/docker/login-action@v2
|
||||||
@@ -78,8 +83,8 @@ jobs:
|
|||||||
username: ${{ secrets.DOCKERHUB_USER }}
|
username: ${{ secrets.DOCKERHUB_USER }}
|
||||||
password: ${{ secrets.DOCKERHUB }}
|
password: ${{ secrets.DOCKERHUB }}
|
||||||
- name: Push to Docker Hub
|
- name: Push to Docker Hub
|
||||||
if: gitea.event_name == 'push' || gitea.event_name == 'schedule'
|
if: ( gitea.event_name == 'push' && github.ref == 'refs/heads/master' ) || gitea.event_name == 'schedule'
|
||||||
run: docker push "${{ env.ABSOLUTE_DH_IMAGE }}:${{ matrix.images }}"
|
run: docker push "${{ env.ABSOLUTE_DH_IMAGE }}:${{ matrix.images }}-test"
|
||||||
- name: Push latest tag
|
- 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"
|
run: docker push "${{ env.ABSOLUTE_DH_IMAGE }}:latest"
|
48
Dockerfile
48
Dockerfile
@@ -6,20 +6,54 @@ WORKDIR /usr/artixlinux-docker
|
|||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
FROM base as build
|
FROM base as build
|
||||||
WORKDIR /usr/artixlinux-docker
|
ARG img=base-devel
|
||||||
ARG img=devel
|
ENV working=/usr/artixlinux-docker
|
||||||
RUN make "dockerfile-base-${img}"
|
ENV BUILDDIR=${working}/build
|
||||||
WORKDIR /usr/artixlinux-docker/output
|
ENV OUTPUTDIR=${working}/output
|
||||||
RUN ROOTFS=base-${img}.tar.zst && \
|
WORKDIR ${working}
|
||||||
sha256sum -c base-${img}.tar.zst.SHA256 && \
|
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 && \
|
mkdir /rootfs && \
|
||||||
tar -C /rootfs --extract --file "${ROOTFS}"
|
tar -C /rootfs --extract --file "${ROOTFS}"
|
||||||
|
|
||||||
FROM scratch AS root
|
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/ /
|
COPY --from=build /rootfs/ /
|
||||||
|
|
||||||
RUN ldconfig && \
|
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
|
ENV LANG=C.UTF-8
|
||||||
CMD ["/usr/bin/bash"]
|
CMD ["/usr/bin/bash"]
|
Reference in New Issue
Block a user