سوالات متداول دستورات داکر در مصاحبه/قسمت اول

1. What are some popular container orchestration systems?
   Some popular container orchestration systems are Kubernetes, Apache Mesos, and Docker Swarm.

2. Which of the following commands creates a new container instance?
   docker run

3. Which of the following commands start container instance?
   docker start, The docker start command is used to start one or more stopped containers.

4. Which of the following commands stop container instance?
   docker stop, The docker stop command is used to stop one or more running containers.

5. docker build
   The docker build command is used to build an image from a Dockerfile.

6. docker run
   The docker run command is used to run a container from an image.

7. docker create
   The docker create command is used to create a new container from an image. This command will create a new container but will not start it. To start the container, you will need to use the docker       
   start command.

8. docker run
   The docker run command is used to launch a new container from a given image. This command takes in a number of different parameters and options that can be used to customize the container that is 
   created. For example, you can use the docker run command to specify the name of the new container, the port mapping for the container, the environment variables for the container, and so on.

9. docker instantiate
   The docker instantiate command creates a new container from a given image, but with a different set of environment variables than the original image. This can be useful for creating different 
   versions of the same image with different settings.

10. Which of the following commands would be most appropriate for creating a new container?
   The most appropriate command for creating a new container would be “docker run.” This command will create a new container with the specified image and run it.

11. docker launch
   There are a few different ways to launch a Docker container. The most common way is to use the “docker run” command. This command will launch a new container with the specified image.

12. docker ps
   The “docker ps” command will list all of the running containers on your system.

13. docker stop
   The “docker stop” command will stop a running container.

14. docker build
   The docker build command is used to create a new Docker image from a given Dockerfile. This command will take in the path to the Dockerfile as its first argument, and then an optional tag name for 
   the new image as its second argument. If no tag name is specified, then the new image will be given the “latest” tag by default.

15. docker run
   The docker run command is used to launch a new container from a given image. This command takes in a number of different parameters and options that can be used to customize the container that is    
   created. For example, you can use the docker run command to specify the name of the new container, the port mapping for the container, the environment variables for the container, and so on.

16. docker create
   The docker create command is used to create a new container from an image. This command will create a new container but will not start it. To start the container, you will need to use the docker 
   start command.

17. Which of the following commands can be used to remove all unused images on your machine?
   The docker system prune command can be used to remove all unused images on your machine.

18. docker rmi -f $(docker images)
   This command will remove all of the images stored on your local machine.

19. docker rm -f $(docker ps -a -q)
   This command will remove all of the containers stored on your local machine, regardless of whether or not they are running.

20. docker rm -f $(docker images)
   This command will remove all of the images that are currently stored in your Docker instance. This can be useful if you want to start from scratch or if you want to clear up some disk space.

21. docker system prune -a
   The docker system prune command will remove all unused data from your Docker system. This includes things like unused containers, images, volumes, and networks. The -a flag will also remove any 
   data that is not associated with a running container, which can be useful for cleaning up after experiments or one-off tasks.

22. docker cleanup -all
   The docker cleanup command is used to remove all unused containers, images, and volumes from your system. This can be helpful if you are running low on disk space, or if you want to clean up your 
   system to prepare for a new Docker installation.

23. Which of the following commands attaches your terminal session to a running container?
   docker attach

24. docker attach [container-name]
   The docker attach command will allow you to attach to a running container. This is useful if you want to check on the status of a running container or if you need to troubleshoot an issue.

25. docker build [path-to-Dockerfile]
   The docker build command is used to build a Docker image from a Dockerfile. This is the first step in creating a container.

26. docker commit [container-name] [new-image-name]
   The docker commit command will create a new image from a container. This is useful if you have made changes to a container and want to save those changes as a new image.

27. docker cp [container-name]:[path-to-file] [destination-path]
   The docker cp command will allow you to copy files from a container to your local machine. This is useful if you need to retrieve files from a container for troubleshooting or analysis.

28. docker create [image-name]
   The docker create command will create a new container from an image. This is the first step in running a container.

29. docker diff [container-name]
   The docker diff command will show you the differences between a container and its image. This is useful for troubleshooting or for understanding what changes have been made to a container.

30. docker events
   The docker events command will show you a stream of events from the Docker daemon. This is useful for monitoring the status of your Docker environment.

31. docker exec -it [container-name] [command]
   The docker exec command will allow you to run a command inside of a container. This is useful for troubleshooting or for running one-off commands inside of a container.

32. docker export [container-name] > [filename.tar]
   The docker export command will export a container as a tar file. This is useful for creating backups of containers or for moving containers to another Docker environment.

33. docker history [image-name]
   The docker history command will show you the history of an image. This is useful for understanding how an image was created or for troubleshooting issues with an image.

34. docker images
   The docker images command will show you a list of all images on your system. This is useful for managing your images and for understanding what images are available.

35. docker import [filename.tar] [new-image-name]
   The docker import command will import a tar file as a new image. This is useful for importing backups of containers or for moving containers to another Docker environment.

36. docker kill
   The docker kill subcommand kills one or more containers.

37. docker connect [container-name]
   The docker connect command is used to connect a running container to a network. This is useful for when you want to connect a container to a specific network in order to access resources on that 
   network.

38. docker link [container-name]
   The docker link command is used to connect a running container to another running container. This is useful for linking together different applications or services that need to communicate with    
   each other. For example, if you have a web server container and a database container, you can link them together so that the web server can access the database.

39. docker join [container-name]
   The docker join command allows you to join an existing container to a new or existing network. This can be useful if you need to connect to a container that is running on a different host.

40. Which of the following commands can be used to find out which network interfaces are being used by a container?
   The docker network inspect` command can be used to find out which network interfaces are being used by a container.

41. docker inspect –networks [container-name]
   This command will give you information about the network settings for a given container. This can be useful for troubleshooting networking issues, or for understanding how a container is 
   configured.

42. docker network create [network-name]
   This command will create a new network with the given name. This can be useful for creating isolated networks for testing or development purposes.

43. docker network rm [network-name]
   This command will remove the given network. This can be useful for cleanup purposes, or for removing unused networks.

44. docker inspect –network [container-name]
   The docker inspect command is a powerful tool that can be used to retrieve detailed information on one or more containers. The –network option can be used to specifically retrieve information on 
   the network settings for a given container. This can be useful for troubleshooting networking issues, or for simply understanding how a container is configured.

 

Leave a reply:

Your email address will not be published.

Site Footer