Fedora container image with QEMU included
- Dockerfile 82.7%
- Makefile 17.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .github/workflows | ||
| .editorconfig | ||
| .gitattributes | ||
| Dockerfile | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
fedora-qemu-container
Fedora container image with QEMU included
My motivation
I need this kind of image because I need to run vyos router as a podman container.
That's why beside qemu-system-x86 and qemu-kvm, I also add iproute and iputils package on this image.
Container image
You can pull our build image using podman:
podman pull forgejo.kodesumber.com/adhisimon/fedora-qemu:latest
or using docker:
docker pull forgejo.kodesumber.com/adhisimon/fedora-qemu:latest
Latest image can be found on:
https://forgejo.kodesumber.com/adhisimon/-/packages/container/fedora-qemu/latest
Included packages
See Dockerfile.
All packages are come from from fedora repository. No custom packages added.
Example quadlet
Here is the example for quadlet file that I use to create vyos in container:
# /etc/containers/systemd/vyos.container
[Unit]
After=network-online.target
StartLimitIntervalSec=5m
StartLimitBurst=5
[Container]
ContainerName=vyos
Image=forgejo.kodesumber.com/adhisimon/fedora-qemu:latest
Pull=newer
AutoUpdate=registry
SecurityLabelType=unconfined_t
SecurityLabelDisable=true
AddCapability=SYS_ADMIN
AddCapability=NET_ADMIN
AddDevice=/dev/kvm
AddDevice=/dev/net/tun
AddDevice=/dev/vhost-net
Volume=/var/local/data0/containers/qemu/vyos.qcow2:/data/vyos.qcow2:Z
Network=podman
Network=vlan2.network
Exec=/bin/sh -c "hash -r && \
echo '=== Create bridge ===' && \
ip link add name br0 type bridge && \
ip link set dev br0 up && \
echo '=== Put eth1 to bridge ===' && \
ip link set dev eth1 master br0 && \
echo '=== Create TAP interface ===' && \
ip tuntap add dev tap0 mode tap multi_queue && \
ip link set dev tap0 up && \
ip link set dev tap0 master br0 && \
echo '=== Run QEMU ===' && \
/usr/bin/qemu-system-x86_64 \
-enable-kvm \
-machine q35 \
-cpu host \
-smp 2 \
-m 2048 \
-drive file=/data/vyos.qcow2,format=qcow2,if=virtio \
-netdev tap,id=hn0,ifname=tap0,script=no,downscript=no,vhost=on,queues=2 \
-device virtio-net-pci,netdev=hn0,mac=99:99:99:99:99:99,mq=on,vectors=6 \
-nographic \
-serial mon:stdio"
# don't forget to change 99:99:99:99:99:99 above with some random mac address
[Service]
Restart=on-failure
RestartSec=30
[Install]
WantedBy=default.target
Additional info
Forgejo action will build this image regularly (monthly).
You can contact me on fediverse. My main fediverse id is @adhisimon.kodesumber.com.