I have a following question related to running images prepated by docker-compose.
Assuming that the compose file shares some ports (and does propper mapping) then while running the image with docker, do I need to list (again) same ports as in the compose file using the “-p” parameter?
Your question is not perfectly clear to me, Maybe you should show what commands you mean. Compose is a plugin of docker after all, so I guess you meant running a docker compose command, but the only way to redefine ports is using docker compose run and not docker compose up.
docker compose run allows you to define ports exactly because that ignores the port definition since you can run the same service multiple times.
The second difference is that the docker compose run command does not create any of the ports specified in the service configuration. This prevents port collisions with already-open ports.