Command Command Problem in docker-compose.yml File

  docker, question

The document said that command is the command executed by default after the container is started.

command: bundle exec thin -p 3000

So, where is the container’s default execution command viewed?
Can you take the official nginx image of Docker Hub as an example?

docker run nginx && docker ps --no-truncThe command column is the command executed by default.

If there is a Dockerfile, it is usually the last line.CMDOrENTRYPOINTIt is

CMD commands can bedocker runThe following command overrides, but ENTRYPOINT’s does not

Whether CMD or ENTRYPOINT has more than one Dockerfile, only the last one will be executed.

e.g :
nginx:stable-alpine Dockerfile

For example, this (doc run-rmnginx: stable-alpine/bin/sh) you will find that nginx is not running
Command in docker-compose.yml is specified after docker run/bin/sh