Docker Command vs Entrypoint

Hi,

My question might be naive, But someone help me, what exactly this means what command has to be executed. Because I am getting confused at this part Dockerfiles for a few commonly used Docker Images are given in the /root (current) folder. Inspect them and try to answer the following questions .

Hello @yashwanth
Could you please specify the lab name so that i could help you.
But regarding the difference between command and entrypoint:
CMD:
set default command and/or parameters, and could be overwrite from the CLI when the container run

Entrypoint:
used to configure a container that we be running as executable
Hope this helps!

Hi,

In Command & Entrypoint lab first question states this Dockerfiles for a few commonly used Docker Images are given in the /root (current) folder. Inspect them and try to answer the following questions . What does that exactly mean, what command should I run in order to get the output.

In this labs, you are required to answer some questions based on the dockerfiles existing in /root directory which are: Dockerfile-mysql Dockerfile-python Dockerfile-ubuntu Dockerfile-wordpress
For example, in question number (2)
" What is the ENTRYPOINT configured on the mysql image"
so all you have to do is
1- $ cat /root/Dockerfile-mysql
or $ cat Dockerfile-mysql
2- inspect the entry point in this docker file, you will find this line
ENTRYPOINT [“docker-entrypoint.sh”]


3- so the right answer would be “docker-entrypoint.sh”
and so on.
Hope this helps!

Just seen this. Inspect literally means look at the files. You can see the directory you are in by using pwd
If you are in root directory then use ls to see which files you have.
To look at a specific file use cat Dockerfile-*** e.g. to look at the mysql file, use cat Dockerfile-mysql
then you can view the contents of the file

Hello @richard.shaw,
Thanks for sharing!