diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..365ff7e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,34 @@ +name: CI + +on: + push: + branches: [main] + + + +env: + REGISTRY_USER: ${{ github.actor }} + REGISTRY_PASSWORD: ${{ github.token }} + IMAGE_REGISTRY: ghcr.io/odilhao + +jobs: + build-swaywm: + permissions: + packages: write + runs-on: ubuntu-24.04 + steps: + - name: Log in to ghcr.io + uses: redhat-actions/podman-login@v1 + with: + username: ${{ env.REGISTRY_USER }} + password: ${{ env.REGISTRY_PASSWORD }} + registry: ${{ env.IMAGE_REGISTRY }} + - uses: actions/checkout@v4 + - name: Build container + run: podman build -t ${{ env.IMAGE_REGISTRY }}/bootc-server:${{ github.sha }} . + - name: Push Image Github SHA + run: podman push ${{ env.IMAGE_REGISTRY }}/bootc-server:${{ github.sha }} + - name: Tag Image as Latest + run: podman tag ${{ env.IMAGE_REGISTRY }}/bootc-server:${{ github.sha }} ${{ env.IMAGE_REGISTRY }}/bootc-server:latest + - name: Push Latest Image + run: podman push ${{ env.IMAGE_REGISTRY }}/bootc-server:latest \ No newline at end of file diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..ac4d10b --- /dev/null +++ b/Containerfile @@ -0,0 +1,5 @@ +FROM quay.io/fedora/fedora-bootc:41 +LABEL org.opencontainers.image.source="https://github.com/Odilhao/bootc-server" + + +RUN dnf install vim -y && dnf clean all \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c66e872 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +SHELL := /bin/bash + +IMAGE_NAME=bootc-server + +build: + sudo podman build -t $(IMAGE_NAME) -f Containerfile + +anaconda-iso: + sudo podman run \ + --rm \ + -it \ + --privileged \ + --pull=newer \ + --security-opt label=type:unconfined_t \ + -v ./output:/output \ + -v ./config.toml:/config.toml:ro \ + -v /var/lib/containers/storage:/var/lib/containers/storage \ + quay.io/centos-bootc/bootc-image-builder:latest \ + --type anaconda-iso \ + --rootfs btrfs \ + ghcr.io/odilhao/bootc-server:latest \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e0448f6 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +Repo to build the demo for DOD BSB. diff --git a/config.toml.example b/config.toml.example new file mode 100644 index 0000000..50a0dbc --- /dev/null +++ b/config.toml.example @@ -0,0 +1,24 @@ +[customizations.installer.kickstart] +contents = """ +text --non-interactive +zerombr +network --bootproto=dhcp --device=link --activate --onboot=on + +clearpart --all --initlabel +part btrfs.boot --fstype=btrfs --size=1024 +part btrfs.main --fstype=btrfs --encrypted --grow --fsoptions="compress=zstd:1,space_cache=v2" + +btrfs /boot --label=fedora-boot btrfs.boot +btrfs none --label=fedora-btrfs btrfs.main +btrfs / --subvol --name=root fedora-btrfs +btrfs /var/home --subvol --name=home fedora-btrfs +ostreecontainer --url docker pull ghcr.io/odilhao/bootc-sway:latest + +firewall --disabled +services --enabled=sshd + +# Only inject a SSH key for root +rootpw --iscrypted locked +sshkey --username root "" + +""" \ No newline at end of file