docker search <image_name>
Eg: docker search redis
docker run <image_name>
To run in detached mode
docker run -d <image_name>
Eg: docker run -d redis
To run in interactive mode
docker run redis -it
Running a specific version of an image
docker run redis:3.2
to use the latest image version
docker run redis:latest
Running the image on container with a given port and an alias name
docker run -d --name <alias_name> -p 6379:6379 redis:latest
Eg: docker run -d redis reditDefPort -p 6379:6379 redis latest
To assign a dynamic port for the container we can use the dynamic version
docker run -d --name redisDynamic -p 6379 redis:latest
docker ps
docker inspect <friendly-name|container-id>
Eg: docker inspect redis
docker logs <friendly-name|container-id>
Eg: docker logs redis
To save the data on the docker host(as volumes) rather than the container(For persistent data storage)
docker run -d --name redisMapped -v /opt/docker/data/redis:/data redis (or)
docker run -d --name redisMapped -v $PWD/data:/data redis
docker images