Suppose you have this Dockerfile with image ubuntu-sleeper built using it:
FROM ubuntu
ENTRYPOINT ["sleep"]
CMD ["5"]
- To just run
sleep 5, rundocker run --name sleeper ubuntu-sleeper. This takes in the default entrypoint/base commandsleepand appends the default command arg5 - To override the default command to run
sleep 6, rundocker run --name sleeper ubuntu-sleeper 6. - To override the default entrypoint and command to run
sleep2.0 10, rundocker run --name sleeper --entrypoint sleep2.0 ubuntu-sleeper 10