janiussyafiq commented on issue #13775:
URL: https://github.com/apache/apisix/issues/13775#issuecomment-5290276530
Hi @wangchao732, I reproduced your exact chain (run `--user root`, `docker
commit`, your Dockerfile with openjdk-21-jdk-headless, `chown -R apisix:root`,
`USER apisix`) and the resulting image starts APISIX normally, so the
commit-based image itself is fine.
What you observed is expected behavior of the entrypoint.
`/docker-entrypoint.sh` only starts APISIX when its first argument is
`docker-start`:
```bash
if [[ "$1" == "docker-start" ]]; then
...
exec /usr/local/openresty/bin/openresty -p /usr/local/apisix -g 'daemon
off;'
fi
exec "$@"
```
Running `bash /docker-entrypoint.sh` with no argument falls through to `exec
"$@"`, which does nothing: it exits 0 with no output and no openresty process,
exactly what you saw. The same command with the argument works: `bash
/docker-entrypoint.sh docker-start`.
The most common way to hit this in a real deployment is a Kubernetes
`command:` override, which replaces the image CMD (`docker-start`), so the
container exits immediately and silently. If they override the command, either
remove them or use:
```yaml
command: ["/docker-entrypoint.sh"]
args: ["docker-start"]
```
Let me know if this explains the issue you encountered, and if not feel free
to reply with more details.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]