Docker

Docker Basic Commands

Basic
: docker version
: docker -v
: docker infod
: docker –help
: docker login
————————————
Images
: docker images
: docker pull
: docker rmi
————————————
Containers
: docker ps
: docker run
: docker start
: docker stop
————————————
System
: docker stats
: docker system df
: docker system prune

Docker Commands to download ubuntu image and then start, stop it :
1. docker login
Username: …
Password: …
(Enter your DockerHub username and password)
2. Docker run ubuntu (It will install the ubuntu image)
Or
docker pull ubuntu
Or (with version)
docker pull ubuntu:18.04
3. Docker run —-name=MyUbuntu -it ubuntu bash(It will start the image). Type ls to see ubuntu folders
4. Open another terminal and type “docker ps”
5. Copy the ubuntu container ID e.g. “a3513826aaba”
6. docker start a3513826aaba or docker stop a3513826aaba