keycloak /opt/jboss/tools/docker-entrypoint.sh出现错误:第47行:KEYCLOAK_FRONTEND_URL

时间:2019-11-18 04:36:36

标签: docker keycloak

在运行命令docker-compose之后,使用此配置

compose.yml

version: '3'

volumes:
  postgres_data:
      driver: local

services:
  bubblesassurance-postgres-keycloak:
    container_name: bubblesassurance-postgres-keycloak
    image: postgres
    volumes:
    - postgres_data:/var/lib/postgresql/data
    networks:
      - bubblesassurance-network
    environment:
      - POSTGRES_PASSWORD=password
      - POSTGRES_DB=keycloak
      - POSTGRES_USER=keycloak
  bubblesassurance-keycloak:
    container_name: bubblesassurance-keycloak
    image: jboss/keycloak
    depends_on:
      - bubblesassurance-postgres-keycloak
    networks:
      - bubblesassurance-network
    environment:
      - DB_VENDOR=POSTGRES
      - DB_ADDR=bubblesassurance-postgres-keycloak
      - DB_DATABASE=keycloak
      - DB_USER=keycloak
      - DB_PASSWORD=password
      - KEYCLOAK_USER=admin
      - KEYCLOAK_PASSWORD=admin
    ports:
      - 8080:8080
  bubblesassurance-postgres-api:
    container_name: bubblesassurance-postgres-api
    image: postgres
    networks:
      - bubblesassurance-network
    environment:
      - POSTGRES_DB=bubblesassurance
      - POSTGRES_USER=api
      - POSTGRES_PASSWORD=BonMatinMatin      
    ports:
      - 5432:5432
networks:
  bubblesassurance-network:
    driver: bridge

我在consol中遇到此错误,但这是我第一次遇到

bubblesassurance-keycloak             | Added 'admin' to '/opt/jboss/keycloak/standalone/configuration/keycloak-add-user.json', restart server to load user
bubblesassurance-keycloak             | /opt/jboss/tools/docker-entrypoint.sh: line 47: KEYCLOAK_FRONTEND_URL: unbound variable

在退出后显示代码1

但是我不明白我的麻烦,请帮助我

1 个答案:

答案 0 :(得分:0)

尝试在环境定义中将KEYCLOAK_FRONTEND_URL添加到您的compose.yml文件中:

      - DB_VENDOR=POSTGRES
      - DB_ADDR=bubblesassurance-postgres-keycloak
      - DB_DATABASE=keycloak
      - DB_USER=keycloak
      - DB_PASSWORD=password
      - KEYCLOAK_USER=admin
      - KEYCLOAK_PASSWORD=admin
      - KEYCLOAK_FRONTEND_URL=''

如果您查看entrypoint.sh的内容,则期望将KEYCLOAK_FRONTEND_URL设置为某种内容。...因此,请尝试对其进行设置,看看会发生什么。