Beaglebone-green-node image hangs on run

This is the startup log for my container which is hanging:

Systemd init system enabled.
systemd 215 running in system mode. (+PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR)
Detected virtualization 'other'.
Detected architecture 'arm'.
Set hostname to <6d0673a96234>.
Failed to configure loopback device: Permission denied

I’m running the container like this:

sudo docker run \
-it \
--name bbg \
-v ~/Documents/project:/home/debian/Documents/project \
--device=/dev/ttyS2 \
--device=/dev/ttyS4 \
--device=/dev/rtc1 \
--privileged \
spruce/beaglebone-green-node bash

I can hold CTRL and press P then Q to exit that and see that my docker container is still running, after which I can log into it with sudo docker exec -it bbg bash but I’d like to overcome the problem and understand it better.

Hi,

This happens because the image you are using is setting the entry point. In order to overwrite that you will need to run it with an - -entrypoint argument.

Ref. : https://docs.docker.com/engine/reference/run/#entrypoint-default-command-to-execute-at-runtime

Regards,
Andrei

Thanks @agherzan but when I change

CMD [ “/home/debian/startup.sh” ]
to

ENTRYPOINT [ “/home/debian/startup.sh” ]
I can install the container without it appearing to hang but when I do docker ps -a I can see my container just keeps restarting and I can’t log in.

Conversely, if I use CMD, it appears to hang and I see a log in my console from the .sh script over and over but when I CMD-Q, CMD-A to break out and docker ps -a, I can see the docker is continuously up, not restarting. Further, I can log in.

Any more suggestions? Thanks!