Skip to main content


Showing posts from December, 2018

Docker - Basic Commands


Following are frequently used Docker commands.

Check the docker version.
docker -version
Pull image from docker repository.
docker pull <image_name:tag> docker pull nginx
List local images.
docker images
Create a container from docker image.
docker run docker run -it -d nginx docker run --name my-nginx -it -d nginx
List running containers.
docker ps docker ps -a
Access the running container.
docker exec docker exec -it ubuntu bash
Stop running container.
docker stop
Kill running container.
docker kill
Delete a container.
docker rm <container_id>
Delete an image from local storage.
docker rmi <image_id>
Build a docker image from a given Docker file.
docker build .