Import opennebula-docker dockerfile

This commit is contained in:
Nico Schottelius 2024-12-21 15:44:01 +01:00
parent 952eb8b545
commit 4c1752d5e6
5 changed files with 57 additions and 0 deletions

View file

@ -0,0 +1,21 @@
FROM debian:bookworm
#RUN apt-get update && apt-get -y dist-upgrade
RUN apt-get update
RUN echo deb http://downloads.opennebula.org/repo/6.0/Debian/10/ stable opennebula > /etc/apt/sources.list.d/opennebula.list
RUN apt-get install -y gnupg2 openssh-server strace sudo wget
RUN apt-get install -y ceph-common
RUN wget -O - https://downloads.opennebula.org/repo/repo.key | apt-key add -
RUN apt-get update && apt-get install -y --no-install-recommends opennebula-node-kvm
RUN mv /usr/bin/virsh /usr/bin/virsh.orig
COPY virsh /usr/bin/virsh
COPY opennebula-virsh /etc/sudoers.d
COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
# Need to run:
# - /usr/sbin/libvirtd
# - sshd

18
opennebula-docker/build.sh Executable file
View file

@ -0,0 +1,18 @@
#!/bin/sh
if [ $# -ne 1 ]; then
echo $1 version
echo $(git describe --always)
exit 1
fi
version=$1; shift
set -e
docker build -t harbor.k8s.ungleich.ch/ungleich-public/opennebula-docker:$version .
echo "Press enter to push, ctr-c for abort"
read foo
docker push harbor.k8s.ungleich.ch/ungleich-public/opennebula-docker:$version

14
opennebula-docker/entrypoint.sh Executable file
View file

@ -0,0 +1,14 @@
#!/bin/sh
if [ -f /config/authorized_keys ]; then
cp /config/authorized_keys ~oneadmin/.ssh/
chown oneadmin:oneadmin -R ~oneadmin/.ssh/
chmod og-rwx ~oneadmin/.ssh/
fi
/etc/init.d/ssh start
# It dies from time to time, don't be confused about it
while true; do
/usr/sbin/libvirtd
done

View file

@ -0,0 +1 @@
oneadmin ALL=(ALL:ALL) NOPASSWD: /usr/bin/virsh.orig *

3
opennebula-docker/virsh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
# without sudo, oneadmin cannot read capabilities
sudo virsh.orig "$@"