Skip to content

Commit

Permalink
toolbox-virt-manager: New toolbox image with virt-manager & virt-install
Browse files Browse the repository at this point in the history
  • Loading branch information
travier committed Jan 31, 2024
1 parent a337aeb commit 0791394
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/toolbox-virt-manager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: "Build toolbox-virt-manager image"

env:
NAME: "toolbox-virt-manager"
REGISTRY: "quay.io/travier"

on:
pull_request:
branches:
- main
paths:
- 'toolbox-virt-manager/**'
- '.github/workflows/toolbox-virt-manager.yml'
push:
branches:
- main
paths:
- 'toolbox-virt-manager/**'
- '.github/workflows/toolbox-virt-manager.yml'
schedule:
- cron: '0 0 * * MON'

permissions: read-all

# Prevent multiple workflow runs from racing to ensure that pushes are made
# sequentialy for the main branch. Also cancel in progress workflow runs for
# pull requests only.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
build-push-image:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Build container image
uses: redhat-actions/buildah-build@v2
with:
context: ${{ env.NAME }}
image: ${{ env.NAME }}
tags: latest
containerfiles: ${{ env.NAME }}/Containerfile
layers: false
oci: true

- name: Push to Container Registry
uses: redhat-actions/push-to-registry@v2
id: push
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main'
with:
username: ${{ secrets.BOT_USERNAME }}
password: ${{ secrets.BOT_SECRET }}
image: ${{ env.NAME }}
registry: ${{ env.REGISTRY }}
tags: latest

- name: Login to Container Registry
uses: redhat-actions/podman-login@v1
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main'
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.BOT_USERNAME }}
password: ${{ secrets.BOT_SECRET }}

- uses: sigstore/[email protected]
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main'

- name: Sign container image
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main'
run: |
cosign sign -y --key env://COSIGN_PRIVATE_KEY ${{ env.REGISTRY }}/${{ env.NAME }}@${{ steps.push.outputs.digest }}
env:
COSIGN_EXPERIMENTAL: false
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
15 changes: 15 additions & 0 deletions toolbox-virt-manager/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM registry.fedoraproject.org/fedora-toolbox:39

# - Install virt-manager & virt-install
RUN dnf -y distrosync && \
dnf -y install \
vim \
virt-install \
virt-manager \
zsh \
&& \
dnf clean all

# No need to clear the output as we will never use ZSH as a login shell and
# this clears output when exiting toolboxes.
RUN sed -i '/clear/d' /etc/zlogout
1 change: 1 addition & 0 deletions toolbox-virt-manager/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# virt-manager & virt-install in a toolbox container

0 comments on commit 0791394

Please sign in to comment.