DOCKER RUN A CONTAINER code example

Example 1: how to start docker

systemctl start docker.service
#(OR)
systemctl start docker
# it will start docker

Example 2: docker run name

docker run --name <container name> -dp <local port>:<container port> <image>

Example 3: docker start container

$ docker start my_container

Example 4: docker run command on container

sudo docker exec -it <container name> <command>

Example 5: docker start container

docker start -a <container_id>

Example 6: start a docker container

$ docker start <container_id>