Search code examples
dockerdockerfilekeycloakamazon-ecs

Error Encountered While Running Keycloak Docker Image on ECS Task


I have a Docker image with the following settings pushed to ECR:

# Keycloak image as the base
FROM bitnami/keycloak:23.0.4

# Expose the port
EXPOSE 8080

I am running an ECS Task using this image, with the following environment variables:

  ecs_auth_env = [
  {
    "name": "KEYCLOAK_DATABASE_NAME",
    "value": "keycloak",
  },
  {
    "name": "KEYCLOAK_DATABASE_HOST",
    "value": "endpoint-of-database",
  },
  {
    "name": "KEYCLOAK_DATABASE_USER",
    "value": "admin",
  },
]
  ecs_auth_secrets = [
  {
    "name": "KEYCLOAK_DATABASE_PASSWORD",
    "valueFrom": "password.arn"
  }
]

However, when running the ECS task, I encounter the following error:

January 24, 2024 at 10:37 (UTC+2:00)    sed: -e expression #1, char 54: unterminated `s' command    auth
January 24, 2024 at 10:37 (UTC+2:00)    keycloak INFO ==> Configuring database settings auth
January 24, 2024 at 10:37 (UTC+2:00)    keycloak INFO ==> Found PostgreSQL server listening at 

I did not set a SED command, and I am unsure where to start troubleshooting. Any advice on resolving this issue would be greatly appreciated.

Thank you.


Solution

  • The problem was with "valueFrom": "password.arn". After changing it to "valueFrom": "password.arn:password::", it started working.