How to use docker-php-ext-install command on the docker_container of ansible modules.

I faced any problems that is couldn't use command option of a docker_container module.

I need customize php-fpm container, so I used docker-php-ext-install command in docker_container's command option.
But I had any struggle points.

My struggles..

  1. I didn't recognize command option's reference detail.
    1. Is parameter type string? list?  fmm??
  2. Importance of ENTRYPOINT(docker-php-entrypoint?? what's this?)
  3. In using command option, Docker container shutting down immediately.
    • PHP-fpm container is uses exposed port. Why shutting down????

How to

Let me get straight the point, this playbook is a my solution.


Answer of my struggles


A command option of docker_container can receive one of shell command.


"ping -c 5"

Both styles can use too.


"docker-php-entrypoint" distinguish argument's '-'
If entrypoint option and command option that both have a some parameter, Executing that the command option is option of entrypoint's.


PHP7-fpm docker container runs "php-fpm" shell command on the command that is equivalent of dockerfile's CMD directive.
However, my wrong playbook didn't have php-fpm command at last.
Therefore all commands successfully done, and container shutting down.


So, bash commands option helped my solution.

"/bin/bash -c '{any commands of combined from &&}'" 


Please your advices, comments.



このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください