dockeraptible

How to display custom message on Aptible ssh login


I want to display a custom message whenever anyone creates a SSH session on Apitble.

To do this, I have added a entrypoint script in Dockerfile to display the message.

echo "message"
exec "$@"

But this is causing before_release commands execution failure.

Apitble is passing chained commands, for ex: command1 args && command2 args to the docker.
Docker is executing command1 and treating args && command2 args as it's arguments and throwing this error.

command1: error: unrecognized arguments: && command2 args

Solution

  • I am not able to reproduced this issue with local containers. I don't know how Aptible passes arguments to container for execution but, talked to support and they provided two solutions.

    1. Put commands inside a script, and call that one command alone from before_release.
    2. Use exec /bin/sh -c "$*", instead of exec "$@" in your entrypoint.sh script