sysbox
                                
                                 sysbox copied to clipboard
                                
                                    sysbox copied to clipboard
                            
                            
                            
                        Is that a right way that use docker entrypoint to excute .sh file and put process /sbin/init into the CMD ?
Hi, it's me again, I have a question about process /sbin/init in docker, here is my dockerfile : Dockfile and my script.sh file: script.sh and my docker-compose.yml: docker-compose.yml
base on these file I build a image and named "base", and excecute cmd docker-compose up and the log information like this :


you see the output log information stuck  the message "Finished Update UTMP about System Runlevel Changes.", whereas I can still use ssh to visit the container , and so far everything is fine inside the container :

I worry about the situation that systemd log information stuck , here is my question:
- Is there something wrong I don't know? if exist please tell me.
- Is a right way that use docker entrypoint to excute script and put process /sbin/init into the CMD ?
thanks, Xiaotong.Zhao
Hi @XiaotongZhao, thanks again for using Sysbox.
I don't think it's working properly, as we would expect systemd to initialize. I suspect the problem is the way the CMD and ENTRYPOINT instructions are set up in the Dockerfile.
Question: what happens if you use only the ENTRYPOINT and remove the CMD instruction?
ENTRYPOINT [ "/sbin/init"]
Hi @ctalledo, thanks for your reply so fast,
Considering your question,I removed the CMD and change dockerfile like this:

the log information like this:

as you see, the log information output successful, compare to log information before, it's just a little difference
Thanks @XiaotongZhao.
as you see, the log information output successful, compare to log information before, it's just a little difference
Did systemd reach the login prompt? It seems it got stuck too, but just a little bit later.
Hi, @ctalledo
If I use docker-compose to run container, it wouldn't reach the login prompt, but if I run container base on the command like this :
docker run --runtime=sysbox-runc -it --rm -P --name=test  --hostname=syscont base
it would reach login prompt, like this:
Thanks, Xiaotong.Zhao