Basic Docker Commands With Examples – Docker
Basic Docker Commands
$ docker --versionThis command returns the version of Docker which is installed
docker pull
$ docker pull ubuntuThis command pulls a new Docker image from the Docker Hub
docker images
$ docker imagesThis command lists down all the images in your local repo
docker container
$ docker container logsThis command is used to perform various operations on the
container. Refer to www.docs.docker.com for more info.$ docker container kill $ docker container rm $ docker container run $ docker container startdocker login
$ docker loginThis command is used to Login to Docker Hub repo from the CLI
docker push
$ docker push vardhanns/MyUbuntuImageThis command pushes a Docker image on your local repo to the Docker Hub
docker ps
$ docker psThis command lists all the running containers in the host
If -a flag is specified, shutdown containers are also displayed
$ docker ps -adocker rm
$ docker rm fe6e370a1c9cThis command removes the container whose Container ID is specified in arguments.
docker rmi
$ docker rmi MyUbuntuImageThis command removes the image whose name has been specified in arguments
docker exec
$ docker exec -it fe6e37ea1c9c bashThis command is used to access an already running container and perform operations inside the container
docker export
$ docker export -- output-"latest.tar" mycontainerThis command is used to export a Docker image into a tar file in your local system
docker import
$ docker import /home/edureka/Downloads/demo.tgzThis command is used to import the contents of a tar file(usually a Docker image) into your local repo
- Most Used Docker Commands
- What is OOCSS ? (Object Oriented CSS)