-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
88 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--- | ||
name: fedora41 | ||
|
||
on: | ||
pull_request: | ||
push: | ||
paths: | ||
- 'fedora41/**' | ||
- '.github/workflows/fedora41.yml' | ||
schedule: | ||
- cron: '10 6,15 * * 1,6' | ||
workflow_dispatch: | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
# Test the image builds and works correctly. | ||
test: | ||
name: Test fedora41 | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-22.04] | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- name: Test building image. | ||
run: cd fedora41 && docker build -t fedora41 . | ||
|
||
- name: Run the built image. | ||
run: docker run --name test-container -d --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro fedora41 | ||
|
||
# If on master branch, build and release image. | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
needs: test | ||
if: github.ref == 'refs/heads/master' | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: docker/setup-qemu-action@v2 | ||
- uses: docker/[email protected] | ||
|
||
- name: Login to DockerHub | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push image. | ||
uses: docker/[email protected] | ||
with: | ||
context: fedora41/ | ||
file: fedora41/Dockerfile | ||
platforms: linux/amd64, linux/arm64, linux/ppc64le, linux/s390x | ||
push: true | ||
tags: | | ||
${{ github.repository }}:fedora41, ${{ github.repository }}:rawhide |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM fedora:41 | ||
|
||
LABEL maintainer="Michael Buluma" | ||
LABEL build_date="2024-03-25" | ||
|
||
ENV container=docker | ||
|
||
# Enable systemd. | ||
RUN dnf -y install systemd && dnf clean all && \ | ||
(cd /lib/systemd/system/sysinit.target.wants/ ; for i in * ; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i ; done) ; \ | ||
rm -f /lib/systemd/system/multi-user.target.wants/* ;\ | ||
rm -f /etc/systemd/system/*.wants/* ;\ | ||
rm -f /lib/systemd/system/local-fs.target.wants/* ; \ | ||
rm -f /lib/systemd/system/sockets.target.wants/*udev* ; \ | ||
rm -f /lib/systemd/system/sockets.target.wants/*initctl* ; \ | ||
rm -f /lib/systemd/system/basic.target.wants/* ;\ | ||
rm -f /lib/systemd/system/anaconda.target.wants/* | ||
|
||
VOLUME ["/sys/fs/cgroup"] | ||
CMD ["/sbin/init"] |