FROM quay.io/fedora/fedora-bootc:44
# From the netbird installation page
COPY <<EOF /etc/yum.repos.d/netbird.repo
[netbird]
name=netbird
baseurl=https://pkgs.netbird.io/yum/
enabled=1
gpgcheck=1
gpgkey=https://pkgs.netbird.io/yum/repodata/repomd.xml.key
repo_gpgcheck=1
EOF
# From another computer, where I already had netbird installed.
COPY <<EOF /etc/systemd/system/netbird.service
[Unit]
Description=NetBird mesh network client
ConditionFileIsExecutable=/usr/bin/netbird
After=network.target syslog.target
[Service]
StartLimitInterval=5
StartLimitBurst=10
ExecStart=/usr/bin/netbird "service" "run" "--log-level" "info" "--daemon-addr" "unix:///var/run/netbird.sock" "--log-file" "/var/log/netbird/client.log"
Restart=always
RestartSec=120
EnvironmentFile=-/etc/sysconfig/netbird
Environment=SYSTEMD_UNIT=netbird
[Install]
WantedBy=multi-user.target
EOF
RUN <<EOF
set -ex
dnf --setopt=tsflags=noscripts install -y netbird
systemctl enable netbird.service
dnf clean all
rm -rf /run/dnf/ /var/log/dnf5.log /var/cache/libdnf5/ /var/lib/dnf/
bootc container lint
EOF
Then I built and pushed the image.
podman build ...
podman push
And on the target computer.
# Not sure if this step was necessary... bootc might pull too... idk.
podman pull <reg>/my-image:latest
sudo bootc switch <reg>/my-image:latest
# Verified that my image was staged.
sudo bootc status
sudo reboot
And later when you publish a new :latest, you run this.