curl -fsSL https://get.docker.com -o get-docker.sh | sh
sudo usermod -aG docker <username>
docker version -> check for status of the server and
client
docker info -> config values
docker -> Gives list of all commands available
docker <command> -> old waydocker <command> <sub-command> -> format
of the management command
Image -> Binaries, Libraries, Source code the make up the application
Container -> Running instance of that image, Can have many container running off of same image
docker container run --publish 80:80 nginx
docker container run --publish 80:80 --detach nginx : Runs
the container in the background
docker container run --publish 80:80 --detach --name myserver
nginx: Specify custom name
docker container ls: Lists all the
running containers
docker container ls -a: Lists all the containers
docker container run: Starts a new container
docker container start: Starts an existing stopped container
docker container logs <name>
docker container run command
docker search <name>: Search on docker hub for image
docker images: List all local images
docker container top <name>: Information about the
processes running inside the container
docker container inspect <name>: Metadata about the
container (JSON format)
docker container stats <name>: Performance stats about
all containers
docker container run -it
docker container start -ai <name>
a: Attach STDOUT/STDERR and forward signals
i: Attach container's STDIN
docker container exec -it <name>: Run commands
inside an already running container
We can only run the command which already exist inside the image
docker container run -p host:container: Publish a container's
port(s) to the host
docker container port <name>: Get port details for the
container
docker network ls: Lists all networks
docker network inspect <name>: Info about the network
docker network connect <network> <container>:
Attach a container to a network, Dynamically creates a NIC in the
container connected to a virtual network
docker network disconnect <network> <container>
docker container run --link <list> to link the
containers to each other in the default bridge network