#Kubernetes

Опубликовано: 12 Октябрь 2024
на канале: Tech IT Factory
460
11

#TeluguITFactory

Contact: Any Queries 6305598849,.
WeekEnd : 8639123675

Email: [email protected]
Telegram Channel: Telugu IT Factory
_________________________________________________________________________________________
Here is a list of common Docker commands along with examples that you might find useful for an interview:
Please note them down for your interview.,

docker version: Display the Docker version information.
Example: docker version

docker info: Display system-wide information about Docker.
Example: docker info

docker pull: Pull an image from a registry (e.g., Docker Hub).
Example: docker pull nginx

docker images: List local images in the Docker registry.
Example: docker images

docker build: Build a Docker image from a Dockerfile.
Example: docker build -t my-image:1.0 .

docker run: Run a container from an image.
Example: docker run -d -p 8080:80 --name my-container nginx

docker ps: List running containers.
Example: docker ps

docker ps -a: List all containers (running and stopped).
Example: docker ps -a

docker exec: Run a command inside a running container.
Example: docker exec -it my-container bash

docker logs: Fetch the logs of a container.
Example: docker logs my-container

docker stop: Stop a running container.
Example: docker stop my-container

docker start: Start a stopped container.
Example: docker start my-container

docker rm: Remove a stopped container.
Example: docker rm my-container

docker rmi: Remove an image from the local registry.
Example: docker rmi my-image:1.0

docker push: Push an image to a remote registry (e.g., Docker Hub).
Example: docker push username/my-image:1.0

docker tag: Add a tag to an image, effectively creating an alias.
Example: docker tag my-image:1.0 username/my-image:latest
#techitfactory
#teluguitfactory