Skip to content

Instantly share code, notes, and snippets.

@manishmore
Last active February 1, 2020 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manishmore/218b3bf97c7d0706a37a4b96a7fe00be to your computer and use it in GitHub Desktop.
Save manishmore/218b3bf97c7d0706a37a4b96a7fe00be to your computer and use it in GitHub Desktop.
Practice: DevOps:
The Difference Between Docker Compose And Docker Stack.
Answer: Docker stack is ignoring “build” instructions. You can’t build new images using the stack commands. It need pre-built images to exist. So docker-compose is better suited for development scenarios.
Q: Which is more suitable for Docker Container, Stateless or Stateful application?
A: Stateless applications should be preferred over a Stateful application for Docker Container. For instance, we can create one container from our application and take out the configurable state parameters from the app. Once it is one, we can run the same container with different parameters in production and other environments. Through the Stateless application, we can reuse the same image in distinct scenarios. Also, it is easier to scale a Stateless application that a Stateful application when it comes to Docker Containers.
Q: Explain the disparity between the commands ‘Docker run’ and ‘Docker create’.
Answer: The primary difference between Docker run and Docker create is that if you use the latter, the container is created in a ‘stopped’ state. Also, Docker creates can be used to store and output container ID for use at a later time. The best way to do it is to use ‘docker run’ with —cidfile FILE_NAME as running it again won’t allow overwriting the file.
Question: Briefly explain the Docker Container lifestyle.
Answer: The lifecycle of a Docker Container is:
* Creation of the container
* Running the container
* Pausing the container
* Unpausing the container
* Starting the container
* Stopping the container
* Restarting the container
* Killing the container
* Destroying the container
Question: Name some important Docker commands
Answer: Below are some important Docker commands:
* build: to build an image file for Docker
* create: for creation of a new container
* kill: to kill a container
* dockerd: for launching Docker daemon
* commit: for creating a new image from the container changes
Question: What is termed as Docker Objects?
Answer: Docker Images, Services and Containers are termed as Docker Objects.
* Images: A read-only template with instructions for creating a Docker container
* Containers: A runnable instance of an image
* Services: It allows the scaling of containers across a variety of Docker Daemons, which all work together as a swarm.
Other Docker Objects include Networks and Volumes.
Docker storage drivers:
Answer: Docker supports the following storage drivers:
* overlay2 is the preferred storage driver, for all currently supported Linux distributions, and requires no extra configuration.
* aufs is the preferred storage driver for Docker 18.06 and older, when running on Ubuntu 14.04 on kernel 3.13 which has no support for overlay2.
* devicemapper is supported, but requires direct-lvm for production environments, because loopback-lvm, while zero-configuration, has very poor performance. devicemapper was the recommended storage driver for CentOS and RHEL, as their kernel version did not support overlay2. However, current versions of CentOS and RHEL now have support for overlay2, which is now the recommended driver.
* The btrfs and zfs storage drivers are used if they are the backing filesystem (the filesystem of the host on which Docker is installed). These filesystems allow for advanced options, such as creating “snapshots”, but require more maintenance and setup. Each of these relies on the backing filesystem being configured correctly.
* The vfs stodrage driver is intended for testing purposes, and for situations where no copy-on-write filesystem can be used. Performance of this storage driver is poor, and is not generally recommended for production use.
* Developing custom reporting tools and automated monitoring and alerting for builds and environments.
3. Automating and improving manual processes with a range of technologies, techniques, and platforms including PHP, Jenkins, Subversion, Git, PostgreSQL, MySQL, UNIX/Linux, VM Ware, Docker, Vagrant, Ansible, Maven, AWS, and Python, across the Financial, Broadcast and Media Sectors Use volumes
Answer:
Volumes are easier to back up or migrate than bind mounts.
You can manage volumes using Docker CLI commands or the Docker API.
Volumes work on both Linux and Windows containers.
Example:
docker run -d \
--name devtest \
-v myvol2:/app \
nginx:latest
4. Kill all the procs by a particular user without using pkill
Answer:
killall -u USWERNAME
5. What is Active Directory ? How do you make a server join a domain ?
Answer: Active dirctory is a microsoft technology used to manage computers and network devices on the network.
6. Write a command to delete all empty file under a directory.
Answer:
find ~/dirct/ -empty -type f -delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment