Https://kodekloud.com/topic/labs-docker-images-3/

Q. Run an instance of the image webapp-color and publish port 8080 on the container to 8282 on the host.
ā†’ When i am running below command its giving error
docker run webapp-color -p 8282:8080

But when running the same command just by rearranging, its running successfully
docker run -p 8282:8080 webapp-color

Why is that??

The syntax for the -p argument is

-p <host-port>:<container-port>

So " publish port 8080 on the container to 8282 on the host." means

-p 8282:8080

not the other way round.