Skip to content
This repository was archived by the owner on May 24, 2024. It is now read-only.

Commit 8c9e570

Browse files
authored
Merge pull request #487 from cgwalters/split-centos-conditionals
Only set default filesystem to XFS in CentOS
2 parents 8c1487f + 203ce2a commit 8c9e570

19 files changed

+87
-90
lines changed

.github/workflows/build-image.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
version: stream9
1919
- os: centos
2020
version: stream10
21+
- os: fedora
22+
version: 40
2123

2224
steps:
2325
- name: Update podman

.tekton/centos-bootc-pull-request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ metadata:
1919
spec:
2020
params:
2121
- name: image-file
22-
value: centos-bootc.yaml
22+
value: centos-stream-9-tier1.yaml
2323
- name: git-url
2424
value: "{{repo_url}}"
2525
- name: output-image

.tekton/centos-bootc-push.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ metadata:
1919
spec:
2020
params:
2121
- name: image-file
22-
value: centos-bootc.yaml
22+
value: centos-stream-9-tier1.yaml
2323
- name: git-url
2424
value: "{{repo_url}}"
2525
- name: output-image

Containerfile.centos-stream10

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ COPY --from=repos /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial /etc/pki/rpm-gpg
1212
# rpm-ostree doesn't honor /etc/dnf/vars right now
1313
RUN for n in $(ls /etc/dnf/vars); do v=$(cat /etc/dnf/vars/$n); sed -ie s,\$${n},$v, c10s.repo; done
1414
RUN --mount=type=cache,target=/workdir --mount=type=bind,rw=true,src=.,dst=/buildcontext,bind-propagation=shared \
15-
cp -a /buildcontext /src && rm -vf /src/*.repo && cp -a c10s.repo /src && ls -al /src &&\
16-
rpm-ostree compose image --cachedir=/workdir --format=ociarchive --initialize /src/${MANIFEST} /buildcontext/out.ociarchive
15+
cp -a /buildcontext /src && rm -vf /src/*.repo && cp -a c10s.repo /src && ls -al /src && \
16+
rpm-ostree compose image --image-config /buildcontext/centos-bootc-config.json \
17+
--cachedir=/workdir --format=ociarchive --initialize /src/${MANIFEST} /buildcontext/out.ociarchive
1718

1819
FROM oci-archive:./out.ociarchive
1920
# Need to reference builder here to force ordering. But since we have to run

Containerfile.centos-stream9

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@
2626
FROM quay.io/centos/centos:stream9 as repos
2727

2828
FROM quay.io/centos-bootc/bootc-image-builder:latest as builder
29-
ARG MANIFEST=centos-bootc.yaml
29+
ARG MANIFEST=centos-stream-9-tier1.yaml
3030
# XXX: we should just make sure our in-tree c9s repo points to the c9s paths and doesn't require vars to avoid these steps entirely
3131
COPY --from=repos /etc/dnf/vars /etc/dnf/vars
3232
COPY --from=repos /etc/yum.repos.d/centos.repo c9s.repo
3333
COPY --from=repos /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial /etc/pki/rpm-gpg
3434
# rpm-ostree doesn't honor /etc/dnf/vars right now
3535
RUN for n in $(ls /etc/dnf/vars); do v=$(cat /etc/dnf/vars/$n); sed -ie s,\$${n},$v, c9s.repo; done
36-
RUN --mount=type=cache,target=/workdir --mount=type=bind,rw=true,src=.,dst=/buildcontext,bind-propagation=shared rpm-ostree compose image --cachedir=/workdir --format=ociarchive --initialize /buildcontext/${MANIFEST} /buildcontext/out.ociarchive
36+
RUN --mount=type=cache,target=/workdir --mount=type=bind,rw=true,src=.,dst=/buildcontext,bind-propagation=shared \
37+
rpm-ostree compose image --image-config /buildcontext/centos-bootc-config.json --cachedir=/workdir --format=ociarchive --initialize /buildcontext/${MANIFEST} /buildcontext/out.ociarchive
3738

3839
FROM oci-archive:./out.ociarchive
3940
# Need to reference builder here to force ordering. But since we have to run

Containerfile.fedora-40

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# This container build uses some special features of podman that allow
2+
# a process executing as part of a container build to generate a new container
3+
# image "from scratch".
4+
#
5+
# This container build uses nested containerization, so you must build with e.g.
6+
# podman build --security-opt=label=disable --cap-add=all --device /dev/fuse <...>
7+
#
8+
# # Why are we doing this?
9+
#
10+
# Today this base image build process uses rpm-ostree. There is a lot of things that
11+
# rpm-ostree does when generating a container image...but important parts include:
12+
#
13+
# - auto-updating labels in the container metadata
14+
# - Generating "chunked" content-addressed reproducible image layers (notice
15+
# how there are ~60 layers in the generated image)
16+
#
17+
# The latter bit in particular is currently impossible to do from Containerfile.
18+
# A future goal is adding some support for this in a way that can be honored by
19+
# buildah (xref https://github.com/containers/podman/discussions/12605)
20+
#
21+
# # Why does this build process require additional privileges?
22+
#
23+
# Because it's generating a base image and uses containerbuildcontextization features itself.
24+
# In the future some of this can be lifted.
25+
26+
FROM quay.io/fedora/fedora:40 as repos
27+
28+
FROM quay.io/centos-bootc/bootc-image-builder:latest as builder
29+
ARG MANIFEST=fedora-bootc.yaml
30+
COPY --from=repos /etc/dnf/vars /etc/dnf/vars
31+
COPY --from=repos /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-* /etc/pki/rpm-gpg
32+
COPY . /src
33+
RUN rm -vf /src/*.repo
34+
COPY --from=repos /etc/yum.repos.d/*.repo /src
35+
RUN --mount=type=cache,target=/workdir --mount=type=bind,rw=true,src=.,dst=/buildcontext,bind-propagation=shared rpm-ostree compose image \
36+
--image-config /buildcontext/fedora-bootc-config.json --cachedir=/workdir --format=ociarchive --initialize /src/${MANIFEST} /buildcontext/out.ociarchive
37+
38+
FROM oci-archive:./out.ociarchive
39+
# Need to reference builder here to force ordering. But since we have to run
40+
# something anyway, we might as well cleanup after ourselves.
41+
RUN --mount=type=bind,from=builder,src=.,target=/var/tmp --mount=type=bind,rw=true,src=.,dst=/buildcontext,bind-propagation=shared rm /buildcontext/out.ociarchive

c9s-devel-compose.repo

Lines changed: 0 additions & 35 deletions
This file was deleted.

c9s.repo

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
[baseos]
22
name=CentOS Stream 9 - BaseOS
3-
baseurl=http://mirror.stream.centos.org/9-stream/BaseOS/$basearch/os
3+
baseurl=https://composes.stream.centos.org/production/CentOS-Stream-9-20240415.0/compose/BaseOS/$basearch/os
44
gpgcheck=1
55
repo_gpgcheck=0
66
enabled=1
77
gpgkey=file:///usr/share/distribution-gpg-keys/centos/RPM-GPG-KEY-CentOS-Official
88

99
[appstream]
1010
name=CentOS Stream 9 - AppStream
11-
baseurl=http://mirror.stream.centos.org/9-stream/AppStream/$basearch/os
11+
baseurl=https://composes.stream.centos.org/production/CentOS-Stream-9-20240415.0/compose/AppStream/$basearch/os
1212
gpgcheck=1
1313
repo_gpgcheck=0
1414
enabled=1
1515
gpgkey=file:///usr/share/distribution-gpg-keys/centos/RPM-GPG-KEY-CentOS-Official
1616

1717
[nfv]
1818
name=CentOS Stream 9 - NFV
19-
baseurl=http://mirror.stream.centos.org/9-stream/NFV/$basearch/os
19+
baseurl=https://composes.stream.centos.org/production/CentOS-Stream-9-20240415.0/compose/NFV/$basearch/os
2020
gpgcheck=1
2121
repo_gpgcheck=0
2222
enabled=1
2323
gpgkey=file:///usr/share/distribution-gpg-keys/centos/RPM-GPG-KEY-CentOS-Official
2424

2525
[rt]
2626
name=CentOS Stream 9 - RT
27-
baseurl=http://mirror.stream.centos.org/9-stream/RT/$basearch/os
27+
baseurl=https://composes.stream.centos.org/production/CentOS-Stream-9-20240415.0/compose/RT/$basearch/os
2828
gpgcheck=1
2929
repo_gpgcheck=0
3030
enabled=1

centos-stream-10.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@ releasever: stream10
22
variables:
33
distro: "stream10"
44

5-
repos:
6-
- baseos
7-
- appstream
5+
include:
6+
- centos-stream-common.yaml
File renamed without changes.

0 commit comments

Comments
 (0)