Use CMD over ENTRYPOINT for running launch script
Using ENTRYPOINT
as the directive for the long running command is great for treating docker containers like they're binaries. It makes it easier to execute a container with arguments / options provided to it.
A disadvantage is that it makes it harder to get a shell into the container (which should admittedly rarely be needed, but is useful for debugging). If the launch script used the CMD
directive instead, the entrypoint would remain as the default (/bin/sh
afaik but might be /bin/bash
) which means you can run docker exec -it terrareg bash
to get a shell, or docker exec terrareg pwd
to run a command on the container.
Currently, doing this does nothing because the command you pass (e.g. pwd
) gets sent as an argument to the entrypoint.sh
script, which effectively ignores it.
You can manually override the entrypoint, but it's a bit annoying to do.