Skip to content

Use ENTRYPOINT + CMD for easier configurability #146

Description

@ambis

Now there is CMD ["/usr/local/openresty/bin/openresty", "-g", "daemon off;"], but it could be

ENTRYPOINT ["/usr/local/openresty/bin/openresty"]
CMD ["-g", "daemon off;"]

And if I want to override the -g argument, I could do just

docker run openresty/openresty:alpine -g "daemon off; env MY_ENV_FOR_LUA;"

Without having to be concerned where the openresty binary resides.

How to verify functionality

Dockerfile

FROM openresty/openresty:alpine

ENTRYPOINT ["/usr/local/openresty/bin/openresty"]
CMD ["-g", "daemon off;"]

Build it

docker build -t test .

Run it

docker run --rm -it -e FOO=bar test -g 'daemon off; env FOO;'

Exec into and see process with top

    {openresty} nginx: master process /usr/local/openresty/bin/openresty -g daemon off; env FOO;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions