Write a example docker file with 2 CMD, 2 ENTRYPOINT

DevOps

MOTOSHARE 🚗🏍️
Turning Idle Vehicles into Shared Rides & Earnings

From Idle to Income. From Parked to Purpose.
Earn by Sharing, Ride by Renting.
Where Owners Earn, Riders Move.
Owners Earn. Riders Move. Motoshare Connects.

With Motoshare, every parked vehicle finds a purpose. Owners earn. Renters ride.
🚀 Everyone wins.

Start Your Journey with Motoshare
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.