Problem creating new docker image

Hello everybody,

I’m trying to create a new image in my OpenNebula 6.4.0 sunstone from a local docker image. I have this images in my sunstone server:

oneadmin@onefe6:~/datastores/1$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
mysql 8.0 05b458cc32b9 6 days ago 517MB
mysql latest 05b458cc32b9 6 days ago 517MB
nginx alpine c433c51bbd66 4 weeks ago 40.7MB
guacamole/guacd 1.4.0 acb80d4190a0 13 months ago 271MB

And when I try to create a new image in ONE datastore:

oneimage create --name mysql --path ‘docker://mysql?size=700&filesystem=ext4&format=raw&tag=latest’ --datastore 1

I obtain this when execute “oneimige list”:

ID USER GROUP NAME DATASTORE SIZE TYPE PER STAT RVMS
53 oneadmin oneadmin mysql default 700M OS No err 0

If I make a “oneimage show 53” I obtain this message from the error:

IMAGE 53 INFORMATION
ID : 53
NAME : mysql
USER : oneadmin
GROUP : oneadmin
LOCK : None
DATASTORE : default
TYPE : OS
REGISTER TIME : 02/07 14:46:43
PERSISTENT : No
SOURCE :
PATH : docker://mysql?size=700&filesystem=ext4&format=raw&tag=latest
SIZE : 700M
STATE : err
RUNNING_VMS : 0

PERMISSIONS
OWNER : um-
GROUP : —
OTHER : —

IMAGE TEMPLATE
DEV_PREFIX=“sd”
ERROR=“Tue Feb 7 14:46:47 2023 : Error copying image in the datastore: INFO: cp: Copying local image docker://mysql?size=700&filesystem=ext4&format=raw&tag=latest to the image repository ERROR: cp: Command "set -e -o pipefail; /var/lib/one/remotes/datastore/fs/…/downloader.sh ‘docker://mysql?size=700&filesystem=ext4&format=raw&tag=latest’ ‘/var/lib/one//datastores/1/f7b590de4928ff447adc0304407bc2b9’" failed: Error copying Error copying docker://mysql?size=700&filesystem=ext4&format=raw&tag=latest to /var/lib/one//datastores/1/f7b590de4928ff447adc0304407bc2b9”

VIRTUAL MACHINES

From the /var/log/one/oned.log I obtain the same message:

Tue Feb 7 14:46:42 2023 [Z0][ReM][D]: Req:8240 UID:0 IP:127.0.0.1 one.image.allocate invoked , "NAME=“mysql”
Tue Feb 7 14:46:43 2023 [Z0][ImM][I]: Copying docker://mysql?size=700&filesystem=ext4&format=raw&tag=latest to repository for image 53
Tue Feb 7 14:46:47 2023 [Z0][ImM][I]: cp: Copying local image docker://mysql?size=700&filesystem=ext4&format=raw&tag=latest to the image repository
Tue Feb 7 14:46:47 2023 [Z0][ImM][E]: cp: Command “set -e -o pipefail; /var/lib/one/remotes/datastore/fs/…/downloader.sh ‘docker://mysql?size=700&filesystem=ext4&format=raw&tag=latest’ ‘/var/lib/one//datastores/1/f7b590de4928ff447adc0304407bc2b9’” failed: Error copying
Tue Feb 7 14:46:47 2023 [Z0][ImM][I]: Error copying docker://mysql?size=700&filesystem=ext4&format=raw&tag=latest to /var/lib/one//datastores/1/f7b590de4928ff447adc0304407bc2b9
Tue Feb 7 14:46:47 2023 [Z0][ImM][E]: Error copying image in the datastore: INFO: cp: Copying local image docker://mysql?size=700&filesystem=ext4&format=raw&tag=latest to the image repository ERROR: cp: Command “set -e -o pipefail; /var/lib/one/remotes/datastore/fs/…/downloader.sh ‘docker://mysql?size=700&filesystem=ext4&format=raw&tag=latest’ ‘/var/lib/one//datastores/1/f7b590de4928ff447adc0304407bc2b9’” failed: Error copying Error copying docker://mysql?size=700&filesystem=ext4&format=raw&tag=latest to /var/lib/one//datastores/1/f7b590de4928ff447adc0304407bc2b9

Any suggestion about what can be the problem?

Many thanks in advanced.

Hello everybody,

I want to inform a problem with the script remotes/datastore/docker_downloader.sh when you try to create a mysql:latest image from docker hub to be used with firecracker.

The problem is that it is impossible to upload this image with the CLI:
oneimage create --name mysql --path ‘docker://mysql?size=700&filesystem=ext4&format=raw&tag=latest’ --datastore 1

The problem is generated in this block of the script:

Check distro

if [ -z “$distro” ]; then
os_info=$(docker run --rm --entrypoint cat
-e “PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin”
“$docker_hub” /etc/os-release)

distro=$(echo "$os_info" | grep "^ID=.*\n" | cut -d= -f 2 | xargs)
version=$(echo "$os_info" | grep "VERSION_ID=" | cut -d= -f 2 | xargs)

fi

Because the image container is created with Oracle Linux, the character \n doesn’t exist in the line with de OS ID and the result i that the line which would have to give value to distro variable crash and it is impossible to upload this mysql:latest image container.

I have wanted to inform about this problem with image container.

Moreover I want to comment that this script that it is used to upload docker images to ONE also crash in the command docker build some times due to library versions. It happens to me when I tried to upload the docker image guacamole/guacd:1.4.0 and I had to create an special image to solve the dependencies and upload my image.

Many thanks in advanced,

Many thanks inadvanced and best regards,

What OpenNebula version are you using ?

Nevermind, there was a previous reply

Yes, more specifically, I’m using the 6.4.0.1 version.

Many thanks in advanced,

Hi,

any solution to this problem?

Thanks.

Yes, the problem is fixed on 6.6, 6.4 and master branches. See this issue.