Docker Community Forums

Share and learn in the Docker community.

YAML Anchor on same line as alias

I’m trying to create an alias rasa-actions-context whose value itself references another alias. Is there a way to do that?

x-chatbot-server-context:
  chatbot-server-context:
    context: &chatbot-server-context ${GIT_CREDENTIALS}/${ORG}/${REPO}.git#${COMMIT_ID}
  rasa-actions-context:
    context: &rasa-actions-context *chatbot-server-context:rasa_actions_server

I get:

ERROR: yaml.parser.ParserError: while parsing a block mapping
  in "./docker-compose.yml", line 7, column 5