Write a example docker file with 2 CMD, 2 ENTRYPOINT

DevOps

YOUR COSMETIC CARE STARTS HERE

Find the Best Cosmetic Hospitals

Trusted • Curated • Easy

Looking for the right place for a cosmetic procedure? Explore top cosmetic hospitals in one place and choose with confidence.

“Small steps lead to big changes — today is a perfect day to begin.”

Explore Cosmetic Hospitals Compare hospitals, services & options quickly.

✓ Shortlist providers • ✓ Review options • ✓ Take the next step with confidence

FROM ubuntu
MAINTAINER Raju << raju.shankar@quest-global.com>>
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get -y install tzdata
RUN apt-get update && apt-get install git -y && apt-get install -yq apache2
CMD echo "Hello world from first cmd"
CMD echo "Hello world from second cmd"
ENTRYPOINT ["/bin/echo","HEllo from first entrypoint"]
ENTRYPOINT ["/bin/echo","HEllo from second entrypoint"]
Code language: PHP (php)

Test1:

docker run 27d064e1c81a
HEllo from second entrypoint /bin/sh -c echo “Hello world from second cmd”

Test2:

root@ip-172-31-28-155:/home/ubuntu/raju# docker run 27d064e1c81a echo test
HEllo from second entrypoint echo test

Explanation:

Only the second cmd or entrypoint is being considered. Moreover if we try to replace cmd during run time then second entrypoint and run time cmd is considered.