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
4 changed files with 60 additions and 56 deletions

View File

@@ -2,9 +2,9 @@ name: Docker Image CI
on:
workflow_dispatch:
branches: [ master ]
branches: [ main ]
push:
branches: [ master ]
branches: [ master, verbose-dockerfile-pipeline-test ]
pull_request:
branches: [ master ]
schedule:
@@ -20,12 +20,7 @@ jobs:
matrix:
images:
[
base-devel,
base-openrc,
base-runit,
base-s6,
base-dinit,
base
openrc
]
env:
REGISTRY: gitea.artixlinux.org
@@ -43,17 +38,12 @@ jobs:
uses: https://github.com/actions/checkout@v4
- name: Set up docker
run: curl -fsSL https://get.docker.com | sh
# - name: Set up Docker Buildx
# id: buildx
# uses: docker/setup-buildx-action@v2
# with:
# install: true
- 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: 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:
@@ -63,7 +53,17 @@ jobs:
context: .
build-args: |
img=${{ matrix.images }}
tags: "${{ env.ABSOLUTE_IMAGE }}:${{ matrix.images }},${{ env.ABSOLUTE_DH_IMAGE }}:${{ matrix.images }},${{ env.ABSOLUTE_IMAGE }}:latest,${{ env.ABSOLUTE_DH_IMAGE }}:latest"
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: false
context: .
build-args: |
img=${{ matrix.images }}
tags: "${{ env.ABSOLUTE_IMAGE }}:latest,${{ env.ABSOLUTE_DH_IMAGE }}:latest"
- name: Log in to the Container registry
uses: https://github.com/docker/login-action@v2
with:
@@ -71,10 +71,10 @@ jobs:
username: ${{ gitea.actor }}
password: ${{ secrets.PAT }}
- name: Push to Gitea
if: github.ref == 'refs/heads/master' && ( gitea.event_name == 'push' || gitea.event_name == 'schedule' )
run: docker push "${{ env.ABSOLUTE_IMAGE }}:${{ 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: ( github.ref == 'refs/heads/master' && ( gitea.event_name == 'push' || gitea.event_name == 'schedule' ) ) && matrix.images == 'base'
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
@@ -83,8 +83,8 @@ jobs:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB }}
- name: Push to Docker Hub
if: github.ref == 'refs/heads/master' && ( 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: ( github.ref == 'refs/heads/master' && ( gitea.event_name == 'push' || gitea.event_name == 'schedule' ) ) && matrix.images == 'base'
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

@@ -1,13 +1,33 @@
FROM artixlinux/artixlinux:latest AS build
FROM gitea.artixlinux.org/artixdocker/artixlinux:latest as base
WORKDIR /usr/artixlinux-docker
RUN pacman -Syu --noconfirm && \
pacman -Sy --noconfirm artools curl make fakechroot fakeroot
WORKDIR /usr/artixlinux-docker
COPY . .
FROM base as build
ARG img=base-devel
COPY . .
RUN make "dockerfile-${img}"
WORKDIR /usr/artixlinux-docker/output
COPY . .
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 && \

View File

@@ -25,8 +25,6 @@ define rootfs
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.}*'
fakechroot fakeroot chroot $(BUILDDIR) /usr/bin/esysusers --root "/"
ln -fs /usr/lib/os-release $(BUILDDIR)/etc/os-release
# add system users
@@ -55,9 +53,6 @@ endef
clean:
rm -rf $(BUILDDIR) $(OUTPUTDIR)
$(OUTPUTDIR)/base.tar.zst:
$(call rootfs,base,base)
$(OUTPUTDIR)/base-openrc.tar.zst:
$(call rootfs,base-openrc,base,elogind-openrc)
@@ -70,9 +65,6 @@ $(OUTPUTDIR)/base-s6.tar.zst:
$(OUTPUTDIR)/base-dinit.tar.zst:
$(call rootfs,base-dinit,base,elogind-dinit)
$(OUTPUTDIR)/Dockerfile.base: $(OUTPUTDIR)/base.tar.zst
$(call dockerfile,base)
$(OUTPUTDIR)/Dockerfile.base-openrc: $(OUTPUTDIR)/base-openrc.tar.zst
$(call dockerfile,base-openrc)
@@ -103,9 +95,6 @@ dockerfile-base-s6: $(OUTPUTDIR)/Dockerfile.base-s6
.PHONY: docker-file-base-dinit
dockerfile-base-dinit: $(OUTPUTDIR)/Dockerfile.base-dinit
.PHONY: docker-file-base
dockerfile-base: $(OUTPUTDIR)/Dockerfile.base
.PHONY: docker-file-base-devel
dockerfile-base-devel: $(OUTPUTDIR)/Dockerfile.base-devel
@@ -125,10 +114,6 @@ image-base-s6: $(OUTPUTDIR)/Dockerfile.base-s6
image-base-dinit: $(OUTPUTDIR)/Dockerfile.base-dinit
${DOCKER} build -f $(OUTPUTDIR)/Dockerfile.base-dinit -t $(REGISTRY)/$(OWNER)/artixlinux:base-dinit $(OUTPUTDIR)
.PHONY: docker-image-base
image-base: $(OUTPUTDIR)/Dockerfile.base
${DOCKER} build -f $(OUTPUTDIR)/Dockerfile.base -t $(REGISTRY)/$(OWNER)/artixlinux:base $(OUTPUTDIR)
.PHONY: docker-image-base-devel
image-base-devel: $(OUTPUTDIR)/Dockerfile.base-devel
${DOCKER} build -f $(OUTPUTDIR)/Dockerfile.base-devel -t $(REGISTRY)/$(OWNER)/artixlinux:base-devel $(OUTPUTDIR)

View File

@@ -10,12 +10,11 @@
# Supported tags
* latest, base
* base-devel
* base-dinit
* base-openrc
* base-runit
* base-s6
* latest, devel
* dinit
* openrc
* runit
* s6
## Dockerfile repo
@@ -32,8 +31,8 @@
# How to run
```
docker pull artixlinux/artixlinux:base
docker run -it --rm artixlinux/artixlinux:base /bin/bash
docker pull artixlinux/artixlinux:devel
docker run -it --rm artixlinux/artixlinux:devel /bin/bash
```
Note that `--rm` removes the container on exit.