List of 20 docker commands and its use cases with example?

1.docker –version: This command helps you know the installed version of the docker software on your system. 2.docker pull nginx: This command helps you pull images from the central docker repository. 3.docker images: This command helps you in listing all the docker images, downloaded on your system. 4.docker run –it -d centos: This command helps in running containers, from their image name. -It = which basically makes the terminal interactive. -d = which means run the container as a daemon

Read more

List of dockerfile instructions and its Brief Summary?

The format of Dockerfile is similar to the below syntax: # Comment INSTRUCTION arguments A Dockerfile must start with a FROM instruction. There are multiple INSTRUCTIONS that are available in Dockerfile, some of these include: FROM RUN CMD LABEL EXPOSE FROM: The FROM instruction specifies the Base Image from which you are building. RUN: In this we can run our commands for installing the packages ADD: This instruction will give the output of converting tar file in to normal file

Read more

What is the difference between docker exec and attach?

Docker Exec: The docker container exec command runs a new command in a running container. The command started using docker exec only runs while the container’s primary process (PID 1) is running, and it is not restarted if the container is restarted. docker exec [OPTIONS] CONTAINER COMMAND [ARG…] Docker attach: When we start a docker container, we need to decide if we want to run in a default foreground mode or the detached mode. It will attach local standard input,

Read more

What is the difference between docker stop and kill?

Docker Stop: This command will stop the containers which are running. docker stop [container id or name] Docker Kill: This command will kill the container by stopping its execution immediately. docker kill [container id or name] The difference between ‘docker kill’ and ‘docker stop’ gives the container time to shutdown in any situations, when it is taking too much time for getting the container to stop, one can opt to kill it.

Read more

Components of Docker and its Brief Summary?

DOCKER: It is the world’s leading software container technology which is used for creating and managing containers.Docker is an open platform, once we build a docker container, we can run it anywhere, say it windows, Linux, mac whether on a laptop, data center, or in the cloud.The whole idea of docker is for developers to easily develop applications, ship them into containers which can then be deployed anywhere. The Docker components are divided into two categories; a)Basic b) Advanced a)Basic

Read more