1

I have a question regarding the passing of arguments in docker-compose run:

I'm using a Dockerfile that has the following entrypoint:

ENTRYPOINT ["/ bin / wp"]
CMD ["--allow-root", "--help"]

I need --allow-root to ALWAYS be included.

If I run docker-compose run [service], the argument goes by default. But if I run docker-compose run [service] option (option option ...) I need to include the argument manually.

Have you ALWAYS include the argument? Do I need to edit Dockerfile (I'm not the author) or can I do it via docker-compose? I tried the command following this answer, but it didn't not succeed.

That Brazilian Guy
  • 3,328
  • 5
  • 31
  • 49

1 Answers1

1

the ENTRYPOINT is what is run when starting the container and the CMD appends to entrypoint. So if you add --allow-root to entrypoint it should be enough

ENTRYPOINT ["/ bin / wp --allow-root"]
Mazel Tov
  • 2,064
  • 14
  • 26