最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Kong Gateway: I got an error when I run docker-compose up - Stack Overflow

programmeradmin0浏览0评论

Create the kong-gateway container using docker compose, got an error as follow:

[lua] globalpatches.lua:84: sleep(): executing a blocking 'sleep' (0.004 seconds), context: init_worker_by_lua*
[lua] globalpatches.lua:84: sleep(): executing a blocking 'sleep' (0.002 seconds), context: init_worker_by_lua*
[lua] globalpatches.lua:84: sleep(): executing a blocking 'sleep' (0.016 seconds), context: init_worker_by_lua*
[lua] globalpatches.lua:84: sleep(): executing a blocking 'sleep' (0.008 seconds), context: init_worker_by_lua*
[lua] warmup.lua:53: warming up DNS entries ..., context: ngx.timer
[lua] warmup.lua:87: finished warming up DNS entries' into the cache (in 39ms), context: ngx.timer;

The kong-gateway command in docker compose file:


services:
  networks:
    backend:

  postgres:
     ....
     ....
     ....

  kong:
    image: kong/kong-gateway
    platform: linux/amd64
    environment:
      - KONG_DATABASE=postgres
      - KONG_PROXY_ACCESS_LOG=/dev/stdout
      - KONG_ADMIN_ACCESS_LOG=/dev/stdout
      - KONG_PROXY_ERROR_LOG=/dev/stderr
      - KONG_ADMIN_ERROR_LOG=/dev/stderr
      - KONG_ADMIN_LISTEN="0.0.0.0:8001, 0.0.0.0:8444 ssl"
      - KONG_PG_HOST=postgres
      - KONG_PG_USER=postgres
      - KONG_PG_PASSWORD=postgres
      - KONG_CASSANDRA_CONTACT_POINTS=postgres
    ports:
      - 8000:8000
      - 8001:8001
      - 8002:8002
      - 8443:8443
      - 8444:8444
    command:
      - kong
      - start
      - --vv
    restart: no
    networks:
      - backend

But there is no issue when creating the container directly using docker run command:

      docker run \
         -d \
         --platform=linux/amd64 \
         --name kong \
         --network=test_backend \
         -e "KONG_DATABASE=postgres" \
         -e "KONG_PROXY_ACCESS_LOG=/dev/stdout" \
         -e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" \
         -e "KONG_PROXY_ERROR_LOG=/dev/stderr" \
         -e "KONG_ADMIN_ERROR_LOG=/dev/stderr" \
         -e "KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl" \
         -e "KONG_PG_HOST=postgres" \
         -e "KONG_PG_USER=postgres" \
         -e "KONG_PG_PASSWORD=postgres" \
         -e "KONG_CASSANDRA_CONTACT_POINTS=postgres" \
         -p 8000:8000 \
         -p 8001:8001 \
         -p 8002:8002 \
         -p 8443:8443 \
         -p 8444:8444 \
         kong/kong-gateway

There is no issue with the Postgres container, and also the kong migrations (kong bootstrap).

I created the 'kong' database manually in Postgres without any issue. After that manually run the kong migration using docker run, also no issue with this.

发布评论

评论列表(0)

  1. 暂无评论