YAMLブロックで普通にできた。
container_commands:
# Remove all nginx site configuration
10-greetings:
command: |
if [[ -f greetings.txt ]]; then
cat greetings.txt
else
echo "no greetings file found"
fi
できないと思ってたので以前は下記のようにしていたが、明らかに可読性は上記のほうが良い。
command: "[[ -f greetings.txt ]] && cat greetings.txt || echo 'no greetings file found'"