dfki-ric / docker_image_development

Scritps and Dockerfiles to support docker-based, 3D accelerated development and release of docker images
BSD 3-Clause "New" or "Revised" License
7 stars 12 forks source link

Startscripts in release mode require one manual exit #69

Open 0Nel opened 1 year ago

0Nel commented 1 year ago

Executing the example startscript in devel mode works fine. However for release mode you get into the container first and the startscript is only executed once you try to exit the container. I noticed this in the corobx project already, but didnt find the time to look into it up until now.

I can pinpoint the location of the error, but have no idea, why it occurs. The issue is that the docker run ... line within the generate_container function in the docker_commands.bash file won't exit automatically. I already checked all passed arguments, but did not yet figure out why this is happening. I suspect it to be related to the entrypoint.sh somehow. Any idea?

0Nel commented 1 year ago

You can test this with the default images and the example startscript. Setting verbose to true makes the location of the error quite obvious.

planthaber commented 1 year ago

In the release build phase, we tell the container it is initialized, so it doesn't change dockerusers uid to the host uid.

https://github.com/dfki-ric/docker_image_development/blob/master/image_setup/03_release_image/Dockerfile#L14

The entrypoint checks for the file and if it in not existing, it will chnage the uid and exit to have the uid set on the next run: https://github.com/dfki-ric/docker_image_development/blob/master/image_setup/01_base_images/entrypoint.bash#L81 https://github.com/dfki-ric/docker_image_development/blob/master/image_setup/01_base_images/entrypoint.bash#L102

I guess in release mode the contaienr does not exit on the first run, but the script expects it to exit once and restarts the container:

https://github.com/dfki-ric/docker_image_development/blob/master/image_setup/03_release_image/Dockerfile#L14

planthaber commented 1 year ago

Can you test: https://github.com/dfki-ric/docker_image_development/pull/70 ?