forked from CentOS/centos-bootc
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 2.26 KB
/
build-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Build Image
on:
pull_request:
branches:
- main
paths-ignore:
- "docs/**"
workflow_dispatch:
jobs:
build-image:
runs-on: ubuntu-latest
# Yes, this is a one-element matrix, but we may add c10s in the future soon
strategy:
matrix:
os: [centos]
include:
- os: centos
version: stream9
steps:
- name: Update podman
run: |
# from https://askubuntu.com/questions/1414446/whats-the-recommended-way-of-installing-podman-4-in-ubuntu-22-04
ubuntu_version='22.04'
key_url="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/Release.key"
sources_url="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}"
echo "deb $sources_url/ /" | sudo tee /etc/apt/sources.list.d/devel-kubic-libcontainers-unstable.list
curl -fsSL $key_url | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/devel_kubic_libcontainers_unstable.gpg > /dev/null
sudo apt update
sudo apt install -y podman
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Build
run: |
#podman build --security-opt=label=disable --cap-add=all --device /dev/fuse \
# -t localhost/${{ matrix.os }}-${{ matrix.version }}-bootc-wrapped -f Containerfile.${{ matrix.os }}-${{ matrix.version }}
cat > Containerfile << EOF
FROM quay.io/centos-bootc/centos-bootc:stream9
RUN skopeo copy docker://quay.io/fedora/fedora:39 oci-archive:/nested.ociarchive
EOF
podman build -t localhost/${{ matrix.os }}-${{ matrix.version }}-bootc-wrapped .
- name: Extract wrapped archive
run: |
id=$(podman create --log-level=debug --entrypoint=/none localhost/${{ matrix.os }}-${{ matrix.version }}-bootc-wrapped:latest)
podman cp ${id}/nested.ociarchive .
skopeo copy oci-archive:nested.ociarchive containers-storage:localhost/${{ matrix.os }}-${{ matrix.version }}-bootc
- name: Run image
run: podman run --rm -ti localhost/${{ matrix.os }}-${{ matrix.version }}-bootc cat /etc/os-release