1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

F #4089: Add DH distro parameter and root user (#4888)

This commit is contained in:
Christian González 2020-06-05 10:51:47 +02:00 committed by GitHub
parent 63e515e761
commit 51edd58c21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -142,9 +142,11 @@ mkdir -p $dockerdir
mkdir -p $dockerdir/mnt
# Check distro
if [ -z $distro ]; then
distro=`docker run --rm \
-e "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \
$docker_hub cat /etc/os-release | grep "^ID=.*\n" | cut -d= -f 2 | xargs`
fi
if [ -z $distro ]; then
echo "Cannot identified $docker_hub distribution" 1>&2
@ -240,6 +242,7 @@ esac
cat > $dockerfile <<EOC
FROM $docker_hub
USER root
$commands
RUN echo "#Generated by OpenNebula" > /etc/resolv.conf
RUN rm -f /etc/ssh/ssh_host_* > /dev/null 2>&1