dockerdocker-composedockerfiledocker-entrypointdocker-command

entrypoint: "entrypoint.sh" - docker compose


There is no such file by name entrypoint.sh in my workspace.

But below instruction in docker-compose.yml is referring it:

builder: 
  build: ../../
  dockerfile: docker/dev/Dockerfile
  volumes:
    - ../../target:/wheelhouse
  volumes_from:
    - cache
  entrypoint: "entrypoint.sh"
  command: ["pip", "wheel", "--non-index", "-f /build", "."]

where ../docker/dev/Dockerfile has

# Set defaults for entrypoint and command string
ENTRYPOINT ["test.sh"]
CMD ["python", "manage.py", "test", "--noinput"]

What does entrypoint: "entrypoint.sh" actually do?


Solution

  • entrypoint: "entrypoint.sh" overrides ENTRYPOINT ["test.sh"] from Dockerfile.

    From the docs:

    Setting entrypoint both overrides any default entrypoint set on the service’s image with the ENTRYPOINT Dockerfile instruction, and clears out any default command on the image - meaning that if there’s a CMD instruction in the Dockerfile, it is ignored.