multiline shell command in entrypoint of docker-compose file

AWS Lambda functions can run up to 15 minutes
October 11, 2018
AWS Lambda new features announced in AWS reinvent
November 30, 2018

multiline shell command in entrypoint of docker-compose file

multiline shell

Sometimes we need to execute multiline shell commands in entrypoint element of docker-compose file.

Also for program readability perspective, its good idea to split the long command into multiline command.

Extract from docker-compose file:

    entrypoint:
      - "/bin/sh"
      - -ecx
      - | 
          python up --database.address"dbuser@db1:26257" && python --name "app-server" \
          --config "/etc/app/config.yml" --database.address "dbuser@db1:26257" \
          --runtime.env "key=${ENC_KEY}" --runtime.env "api_key={API_KEY}" \
          --runtime.env "api_secret=${API_SECRET}" --runtime.env "forntend_url=${FE_URL}"
    restart: always

So we have to use the ‘|’ and put the multiline command as shown above.

Bitnami