This is what we can infer from the command:
docker run: The docker run command will start the container and display log output in the Terminal. The Terminal will be locked as long as the container runs.
We have seen the --rm option already; it will tell Docker to clean up the container once we stop the execution from the Terminal using Ctrl + C.
The -p8080:8080 option maps port 8080 in the container to port 8080 in the Docker host, which makes it possible to call it from the outside. In the case of Docker Desktop for Mac, which runs Docker in a local Linux virtual machine, the port will also be port-forwarded to macOS, which is made available on localhost. Remember that we can only have one container mapping to a specific port in the Docker host!
With the -e option, we can specify environment variables for the container, which in this case is SPRING_PROFILES_ACTIVE=docker. The SPRING_PROFILES_ACTIVE environment variable is used to tell Spring what profiles to use. In our case, we want Spring to use the docker profile.
Finally, we have product-service, which is the name of the Docker image we built above and that Docker will use to start the container.