[英]How to display custom message on Aptible ssh login
I want to display a custom message whenever anyone creates a SSH session on Apitble. 我想在任何人在Apitble上创建SSH会话时显示一条自定义消息。
To do this, I have added a entrypoint script in Dockerfile to display the message. 为此,我在Dockerfile中添加了一个入口点脚本来显示消息。
echo "message"
exec "$@"
But this is causing before_release
commands execution failure. 但这会导致
before_release
命令执行失败。
Apitble is passing chained commands, for ex: command1 args && command2 args
to the docker. Apitble正在将链接的命令传递给docker,例如:
command1 args && command2 args
。
Docker is executing command1
and treating args && command2 args
as it's arguments and throwing this error. Docker正在执行
command1
并将args && command2 args
作为参数,并抛出此错误。
command1: error: unrecognized arguments: && command2 args
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.
我不知道Aptible如何将参数传递给容器以执行,但是与支持进行了交谈,他们提供了两种解决方案。
before_release
. before_release
单独调用该命令。 exec /bin/sh -c "$*"
, instead of exec "$@"
in your entrypoint.sh
script entrypoint.sh
脚本中使用exec /bin/sh -c "$*"
代替exec "$@"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.