Write a example dockerfile with 2 CMD, 2 ENTRYPOINT and 1 CMD/1ENTRYPOINT and write down a behaviour of it.

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

2CMD/2EntryPoint

FROM ubuntu
MAINTAINER Beema Muhammed <<beema.muhammed@quest-global.com>>
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 "First echo from cmd"
CMD echo "Second echo from cmd"
ENTRYPOINT ["/bin/echo","FirstEntryPoint"]
ENTRYPOINT ["/bin/echo","SecondEntrypoint"]
Code language: PHP (php)

Only second entry point and second cmd got executed

SecondEntrypoint /bin/sh -c echo "Second echo from cmd"Code language: PHP (php)

1CMD/1EntryPoint



FROM ubuntu
MAINTAINER Beema Muhammed <<beema.muhammed@quest-global.com>>
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 "First echo from cmd"
ENTRYPOINT ["/bin/echo","FirstEntryPoint"]



Code language: JavaScript (javascript)
FirstEntryPoint /bin/sh -c echo "First echo from cmd"
Code language: PHP (php)

CMD is passed as an argument to entrypoint