I am using kong db-less declarative mode in a docker container as below:
Dockerfile
FROM kong
USER 0
RUN mkdir -p /kong/declarative/
COPY declarative/kong.yml /kong/declarative/
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN ["chmod", "+x", "/docker-entrypoint.sh"]
RUN cp /etc/kong/kong.conf.default /etc/kong/kong.conf
RUN apk add gettext
and in the docker-compose environment variable, I add MYNAME=amin
In docker-entrypoint.sh I have:
#!/usr/bin/env bash
envsubst < /kong/declarative/kong-template.yml > /kong/declarative/kong.yml
And I use the env variable in kong-template.yml
for example
routes:
- name: gamma
methods:
- GET
paths:
- /$MYNAME/gamma
strip_path: true
However, the kong container stops with an exit error.
Does anybody know what is the problem?
attaching to kong
kong existed with code 0