docker run container code example
Example 1: docker access container
docker exec -it <mycontainer> bash
docker exec -it <mycontainer> sh
Example 2: how to start docker
systemctl start docker.service
systemctl start docker
Example 3: docker compose run
docker-compose up --build -d --remove-orphans
docker-compose -f docker-compose.yml up --build -d --remove-orphans
Example 4: docker run name
docker run --name <container name> -dp <local port>:<container port> <image>
Example 5: docker start container
$ docker start my_container
Example 6: docker run command on container
sudo docker exec -it <container name> <command>