Build all these 5 images and run container and observe the use cases of it.
https://devopsschool.com/tutorial/docker/dockerfile/dockerfile-example-sample-lab.html Docker File 1: /usr/sbin/apache2ctl specified in CMD will run in foreground as a blocking call. Docker File 2: Just exit after echoing “Hello world”. Docker File 3: Just exit after echoing “Hello”. Docker File 4: Same as ‘Docker File 1‘ except port 80 will be shown as exposed port. Docker File 5: Output will be print like : “Hello /bin/sh -c echo “Hello world””. First it will execute ENTRYPOINT then content of CMD will be passed as an arument
Read more