Menu
PHP BABA LOGO
  • Home
  • Interview Questions
    • PHP String Interview Question
    • PHP Array Interview Qutions
    • jQuery Interview Quetions
    • PHP Interviwe Question on php.ini file
    • htaccess File Interview Quetions
  • About
PHP BABA LOGO

Docker Commands

Posted on July 3, 2020July 14, 2020
Install Docker in Linux ubuntusudo apt install docker.io
Check Docker Statussudo systemctl status docker
It provides all the information of docker, and also use to check it is installed or not. docker info
It will show a list of commands that available for us with a short description of what it does. docker –help
It will show help particularly for command with a short description of what it does.docker “cmd” –help
If an image will not available locally it will first download form the network then it will make and run the container and detach from it. docker run “Image Name”
If the image will not available locally it will first download form the network then it will make and run the container and keep it attached on it. docker run -it “Image Name”
It will open the existing container which is running. docker attach “container id”
Get in the bash terminal within a containerdocker exec -it “container id” /bin/bash
It shows only running containers. docker ps
It shows all the containers are available in dockerdocker ps -a
It shows images are available locally in the dockerdocker images
It deletes the container with a given container iddocker rm “Container id”
It deletes the images which any container is not containingdocker rmi “Image id”
It deletes the images forcefully could container containdocker rmi “Image id” –force
Download the imagedocker pull “Image Name”
To see all the running processes in Linuxps -elf(For Linux)
It will show all the running processes in the containerdocker top “container id”
Remove all container (stop container before remove) docker container prune
Stop Docker docker stop “container id”
To detach from the container without closing the container.Ctl+p then Ctl+q
Check changes in container docker diff “container id”
Check historydocker history “container id”
It will show all the commands that were associated with this Container id.docker logs “container id”
Show running container all details (Ex: IPAddress)docker inspect “container id”

Run docker and Bind mount a volume ( copy all project in docker)

docker run -dit -v source_folder:destination_folder “container id”

Example: docker run -dit -v /var/www/html:/var/www/html “container id”

-d, –detach Run container in background and print container ID

Categories

  • Docker
  • Git
  • Interview Questions
  • Laravel
  • Linux
  • php
  • Salesforce

Recent Posts

  • Batch Class in Salesforce
  • Platform Developer I Certification Maintenance (Winter ’24) Get Hands-on with Bind Variables in a SOQL Query
  • How to check Salesforce current release version
  • Salesforce Certification Coupons / Vouchers
  • Nested / Cascade query in SOQL

Recent Posts

  • Batch Class in Salesforce January 25, 2024
  • Platform Developer I Certification Maintenance (Winter ’24) Get Hands-on with Bind Variables in a SOQL Query December 19, 2023
  • How to check Salesforce current release version January 12, 2023
  • Salesforce Certification Coupons / Vouchers July 19, 2022
  • Nested / Cascade query in SOQL May 11, 2022
©2025 The Tech Paper | Powered by Abhinav Trivedi