This page is about the main entry in Docker.
The entry point script is the script called when creating a container from an image with the docker run command
When the entry point program exits, the VM is stopped (killed). A process needs to run in the foreground.
When you run docker like this:
docker run -i -t ubuntu bash
The below script start a process before starting the command given at the command line.
It's a wrapper around the default entrypoint.
If you set the entrypoint in your dockerfile, you need to set it with the exec form otherwise you get no arguments.
#!/usr/bin/env bash
echo Starting the ssh-agent for convenience
eval `ssh-agent`
# Start the passed command ($*)
/bin/sh -c "$*"
docker run --entrypoint /script.sh repo/image
where: How to run a docker image with example to create a container?
The default entrypoint is defined by the ENTRYPOINT instruction.
docker inspect --format "{{range .Config.Entrypoint}}{{.}}{{end}}" (containerName|imageName)
Example on the image org/ubuntu:latest
docker inspect --format "{{range .Config.Entrypoint}}{{.}}{{end}}" org/ubuntu:latest
See Docker - Inspect