[opennebula-docker] add ssh key support

This commit is contained in:
Nico Schottelius 2026-09-03 10:57:00 +02:00
commit 377f44cca5
2 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,17 @@
FROM debian:trixie
RUN apt-get update
RUN apt-get install -y gnupg2 openssh-server strace sudo wget ceph-common
RUN wget -q -O- https://downloads.opennebula.io/repo/repo2.key | gpg --dearmor --yes --output /etc/apt/keyrings/opennebula.gpg
RUN echo "deb [signed-by=/etc/apt/keyrings/opennebula.gpg] https://downloads.opennebula.io/repo/7.1/Debian/13 stable opennebula" > /etc/apt/sources.list.d/opennebula.list
RUN apt-get update && apt-get install -y --no-install-recommends opennebula-node-kvm
COPY virtlogd.conf /etc/libvirt/virtlogd.conf
RUN chmod a+r /etc/libvirt/virtlogd.conf
RUN echo 'auth_unix_ro = "none"' >> /etc/libvirt/libvirtd.conf
RUN echo 'auth_unix_rw = "none"' >> /etc/libvirt/libvirtd.conf
COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]

View file

@ -45,6 +45,15 @@ cat <<EOF > "$key_filename"
key = $(cat /ceph-secret/key)
EOF
if [ -d /ssh-in ]; then
count=$(ls /ssh-in | wc -l)
if [ "$count" -ge 1 ]; then
mkdir -p ~oneadmin/.ssh
cp /ssh-in/* ~oneadmin/.ssh
chown -R oneadmin ~oneadmin/.ssh
chmod og-rwx ~oneadmin/.ssh
fi
fi
while true; do
######################################################################