Binaries inside Docker container images not being started when not explicitly called

I’m building my own Dockerfile with official images as it’s base which I’m adjusting with Ansible for simple configuration changes. Relevant portion of the dockerfile:

FROM php:7.0-fpm
MAINTAINER hyperfocus

# Ansible cmds

EXPOSE 9000
CMD [“php-fpm”]

Whenever the image is built and I try to start it with docker run php_fpm_prod:v0.1 it gives me the error: /bin/sh: 1: [“php-fpm”]: not found.

  • Docker Nginx stopped: [emerg] 1#1: host not found in upstream
  • docker push not actually updating ECR
  • CMake autogenerated Makefile on ubuntu 16.04 docker image prepending “//” to targets
  • Starting mysql container using docker machine with virtual box shared folder
  • Ignite on Docker
  • docker - does it bypass instance-checking limitation like virtual machine
  • But whenever I try to start it with docker run php_fpm_prod:v0.1 php-fpm it starts succesfully:

    [03-Nov-2015 10:24:38] NOTICE: fpm is running, pid 1
    [03-Nov-2015 10:24:38] NOTICE: ready to handle connections
    

    How can I make docker run php_fpm_prod:v0.1 behave like docker run php_fpm_prod:v0.1 php-fpm?

    Thanks.

  • Docker + Nodejs + Private Repo + Private NPM Module - Access Problems
  • unable to login in private docker registry
  • Golang DNS without CGO on a Kubernetes Cluster
  • mongodb with docker-compose [SocketTimeoutException]
  • Making a docker container a part of a vpn
  • Link Running External Docker to docker-compose services
  • One Solution collect form web for “Binaries inside Docker container images not being started when not explicitly called”

    The CMD of a php fpm Dockerfile is already CMD ["php-fpm"] (overriding the debian-jessie CMD), so you shouldn’t need to specify it again.

    Those debian or php fpm Dockerfile don’t define an ENTRYPOINT which means thedefault one applies /bin/sh -c.

    First, make sure, as in “Dockerfile CMD command not found” to use the right quotes:

    CMD ["php-fpm"]
    

    (Or don’t specify the CMD at all, since it will be inherited from the base image)

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.