1
0
Fork 0

Merge pull request #781 from cgwalters/main

Dockerfile: New to build on a bootc image
This commit is contained in:
Jaroslav Škarvada 2025-07-29 12:32:56 +02:00 committed by GitHub
commit d0bd508810
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 54 additions and 0 deletions

2
.dockerignore Normal file
View file

@ -0,0 +1,2 @@
# Avoid rebuilding when this changes
Dockerfile

22
.github/workflows/docker-build.yml vendored Normal file
View file

@ -0,0 +1,22 @@
name: Docker Build
on:
workflow_dispatch:
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Get a newer podman for heredoc support (from debian testing)
run: |
set -eux
echo 'deb [trusted=yes] https://ftp.debian.org/debian/ testing main' | sudo tee /etc/apt/sources.list.d/testing.list
sudo apt update
sudo apt install -y crun/testing podman/testing skopeo/testing
- uses: actions/checkout@v4
- name: Build container
run: sudo podman build -t localhost/tuned .

30
Dockerfile Normal file
View file

@ -0,0 +1,30 @@
ARG base=quay.io/centos-bootc/centos-bootc:stream10
FROM $base as build
COPY tuned.spec /tmp/tuned.spec
# This installs our package dependencies, and we want to cache it independently of the rest.
RUN <<EORUN
set -xeuo pipefail
dnf -y install rpm-build
dnf -y builddep /tmp/tuned.spec
EORUN
# Now copy the rest of the source
COPY . /build
WORKDIR /build
RUN <<EORUN
set -xeuo pipefail
mkdir -p /var/roothome
make rpm
mkdir -p /out
mv ~/rpmbuild/RPMS/noarch/tuned-2*.rpm /out
EORUN
FROM $base
RUN --mount=from=build,target=/build,type=bind <<EORUN
set -xeuo pipefail
dnf -y install /build/out/*.rpm
dnf clean all
rm -rf /var/{lib,cache,log}/*
bootc container lint --fatal-warnings
EORUN