To show the process pull by docker
๐ณ docker ps -a
to give interactive node console
๐ณ docker run -it node
to build docker file
๐ณ docker build .
stop docker container
๐ณ docker stop containerName
run an image
๐ณ docker run -p 3000:80 imageSHA
restart a container
๐ณ docker start containerName
currently running container
๐ณ docker ps
interactive console in docker
๐ณ docker run -it imageSHA
removing docker container
๐ณ docker rm containerName
docker images on hard drive
๐ณ docker images
remove images
๐ณ docker rmi imageSHA
inspecting docker images
๐ณ docker image inspect imgSHA
coping files into & from container
๐ณ docker cp FileName/FolderName elastic_merkle:/ts
naming docker image
๐ณ docker build -t name:tag .
pushing to docker hub
๐ณ docker push imageTAG
pulling image file from docker hub
๐ณ docker pull node
to get the volume stored locally
๐ณ docker volume ls
Volume command in docker
๐ณ docker run -d --rm -p 3000:80 --name feed-app -v feedback:/app/feedback -v "/users/../folderName" -v /app/node_modules feed:volumes
For container communicating with localhost
๐ณ host.docker.internal
To get details of container
๐ณ docker container inspect containerName
Network
๐ณ docker network create networkName
connecting a container to a network
๐ณ docker run -d --name mongodb --network favorites-network mongo
starting docker-compose
๐ณ docker-compose up -d
๐ณ docker-compose down
to start a kubernetes cluster using docker driver
๐พ minikube start --driver=docker
To get deployment object
๐พ kubectl get deployments
To get pods object
๐พ kubectl get pods
delete deployment object
๐พ kubectl delete deployment deploymentObjName
To create deployment object
๐พ kubectl create deployment first-app --image=vidhansharma/kub-first-app:latest
To get the dashboard on browser
๐พ minikube dashboard
To get services
๐พ kubectl get services
Expose a pod
๐พ kubectl expose deployment first-app --type=LoadBalancer --port=8080
To get the port address
๐พ minikube service first-app
Scaling pods
๐พ kubectl scale deployment/first-app --replicas=3
update deployment
๐พ kubectl set image deployment/first-app kub-first-app=vidhansharma/kub-first-app
starting pods in declarative approach
๐พ kubectl apply -f=deployment.yaml/service.yaml
starting services in declarative approach
๐พ kubectl apply -f service.yaml
Deleting the pods & services in Yaml
๐พ kubectl delete -f=deployment.yaml -f=service.yaml
get persistent volume
๐พ kubectl get pv
get pv claim
๐พ kubectl get pvc