What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps Tools | Edureka Rewind
Introduction to Docker
In this section, Sarah introduces the topic of Docker and outlines the agenda for the session.
Why We Need Docker
- Industries faced problems with differences in computing environments between development and production.
- Microservices can be considered small processes that communicate with each other over a network to fulfill one particular goal.
- Advantages of using microservice architecture include easier building and maintenance of applications, easy updates to software or technology stacks, and unaffected application if any service goes down.
Problems with Adopting Microservice Architecture
- Virtual machines result in wastage of resources such as RAM, processor, and disk space.
What is Docker?
- No bullet points associated with timestamps.
Docker Example
- No bullet points associated with timestamps.
How Industries are Using Docker: Indiana University Case Study
- No bullet points associated with timestamps.
Various Components of Docker: Images, Containers, etc.
- No bullet points associated with timestamps.
Hands-On Part: Installing WordPress and phpMyAdmin using Docker Compose
- The hands-on part will focus on installing WordPress and phpMyAdmin using Docker Compose.
Microservices Implementation
In this section, the speaker discusses the implementation of microservices using Docker containers on top of a virtual machine. The speaker explains the difference between virtual machines and Docker containers and why virtual machines are used in this case.
Virtual Machines vs. Docker Containers
- Docker containers are lightweight alternatives to virtual machines that do not require pre-allocation of RAM or disk space.
- A Linux or Unix-based host machine is required to run Docker containers since they do not work on Windows systems.
- Using a virtual machine helps segregate the microservices from the rest of the host machine and allows for more efficient use of resources.
Consistent Computing Environment with Docker
In this section, the speaker explains how Docker solves the problem of inconsistent computing environments throughout the software delivery life cycle.
How Docker Solves Inconsistent Computing Environments
- Docker containers can be used throughout the software delivery life cycle to provide consistent computing environments in development, testing, and production.
- Docker containers use a host operating system instead of a guest operating system like traditional virtual machines.
- Multiple containers can run on top of a single host machine with each container having its own set of dependencies packaged within it.
Workflow for Using Docker
In this section, the speaker outlines a general workflow for using Docker in software development.
General Workflow for Using Docker
- A developer writes a Docker file that defines the application's requirements and dependencies.
- The Docker file produces a Docker image that contains all the necessary dependencies for the application.
- The Docker image is uploaded to Docker Hub, which serves as a repository for public and private Docker images.
- Various teams such as QA or production can pull the image from Docker Hub and prepare it for deployment.
Docker Hub and Microservices
In this section, the speaker explains Docker Hub and how it can be used to upload and pull images. They also discuss a workflow for using Docker in production environments with microservices.
Using Docker Hub
- Docker Hub is a cloud-hosted service provided by Docker where users can upload their own images or pull images from public repositories.
- It functions like a git repository for Docker images.
Workflow for Microservices with Docker
- A build environment containing all dependencies for a microservice is created using Jenkins or any continuous integration server.
- This environment is then deployed onto various teams such as testing, staging, and production.
- Requirements for the microservice are present throughout the software delivery life cycle, eliminating issues that arise when an application works fine in development but not in production.
Case Study: Indiana University and Docker Data Center
The speaker discusses how Indiana University faced several problems before implementing Docker Data Center to modernize their applications and provide security for sensitive student data.
Problems Faced by Indiana University
- Custom scripts were used to deploy applications onto various VMS, requiring many manual steps.
- Their environment was optimized for legacy Java-based applications but needed to begin modernizing their applications.
- They wanted to move from a monolithic architecture to a microservice architecture.
- Sensitive student data required additional security measures.
Solution: Docker Data Center
- Implemented Universal Control Plane, LDAP Swarm CS Engine, and Trusted Registry components of Docker Data Center.
Introduction to Docker Data Center
In this section, the speaker introduces Docker Data Center and explains how it helped Indiana University move from a monolithic architecture to a microservice architecture. The speaker also discusses the benefits of using Universal Control Plane and role-based access controls for security.
Docker Images and Universal Control Plane
- Indiana University moved from a monolithic architecture to a microservice architecture using Docker images.
- Universal Control Plane is used to deploy services onto various hosts with the help of Docker images stored in the Docker Trusted Registry.
- Universal Control Plane allows IT Ops teams to manage their entire infrastructure from one single place with its web user interface.
- Role-based access controls within the Docker Data Center allowed Indiana University to define levels of access for various teams.
Differences between Docker Containers and Virtual Machines
- Pallavi asks about the difference between Docker containers and virtual machines.
- Docker containers are lightweight alternatives to virtual machines that do not have their own operating system. They sit on top of the host operating system.
- Runtime for Docker containers is less than virtual machines because you don't need to boot an OS.
Overview of Various Docker Components
- The speaker moves forward and discusses various components of Docker, starting with the Docker registry.
- The registry stores all your docker images, which can be stored either in public or private repositories locally or on cloud platforms like Dockers' cloud-hosted service, Docker Hub.
- Docker images are read-only templates used to create containers that contain all the dependencies for a particular application or microservice.
Exploring Docker Hub
In this section, the speaker explores Docker Hub and shows how to use it to create public or private repositories and upload images.
Creating Repositories on Docker Hub
- The speaker shows how to sign in with your login credentials on Docker Hub.
- You can create your own public or private repositories and upload images onto them.
Conclusion
In this section, the speaker concludes by summarizing what was covered in the previous sections.
Summary of Topics Covered
- The speaker summarizes topics covered in previous sections, including Indiana University's adoption of Docker Data Center, differences between Docker containers and virtual machines, and an overview of various components of Docker.
- The speaker encourages viewers to explore more about these topics through online resources like tutorials.
Introduction to Docker Images and Containers
In this section, the speaker explains the relationship between Docker images and containers. They also demonstrate how to install Docker on an Ubuntu box, pull a CentOS image from Docker Hub, and run a CentOS container.
Installing Docker on Ubuntu
- To update packages, type
sudo apt get updateat .
- Install recommended packages by typing
sudo apt get installed Linux-image-extra,sudo apt get installed namespace-r, andsudo apt get installed Linux-image-extra-virtualat , , and , respectively.
- Install Docker engine by typing
sudo app get installed Docker-engineat .
- Start the Docker service by typing
sudo service Docker startat .
Pulling a CentOS Image and Running a Container
- Pull a CentOS image from Docker Hub by typing
sudo docker pull sentosat .
- Run a CentOS container by typing
sudo docker run -ID sentosat .
Introduction to Docker Compose
In this section, the speaker introduces the concept of running multiple applications present on various containers with one single command using Docker Compose.
Understanding What is Docker Compose
- Use case scenario for running multiple applications present on various containers with one single command using YAML file that is called "Docker Compose file" at .
- Example of defining three containers, one running a web app, another running a postgres, and another running a redis in a YAML file that is called Docker Compose file at .
Practical Demonstration
- Define all the three containers in one YAML file and execute all these three containers with one single command
docker-compose upat .
Installing Docker Compose
In this section, the speaker installs Docker Compose and creates a WordPress directory.
Installing Docker Compose
- Install Python pip.
- Install Docker Compose using pip.
Creating WordPress Directory
- Create a new directory named "WordPress".
- Navigate to the newly created "WordPress" directory.
Editing Docker Compose YAML File
In this section, the speaker edits the Docker Compose YAML file to define containers for WordPress, MariaDB, and phpMyAdmin.
Editing YAML File
- Open the Docker Compose YAML file using Gedit or any other editor.
- Copy and paste the provided YAML code into the file.
- Define a container named "WordPress" built from an image called "WordPress" on docker Hub.
- Define another container named "WordPress_DB" built from an image called "MariaDB".
- Link "WordPress_DB" with "WordPress".
- Define a third container named "phpMyAdmin" built from an image called corbinu/Docker-phpMyAdmin.
- The port 80 of each container is linked to different ports on the host machine.
Running Containers
In this section, the speaker runs all three containers using Docker Compose.
Running Containers
- Run the command "sudo docker-compose up -d" to pull images and build containers.
- The WordPress installation page can be accessed by typing "localhost:8080" in a browser.
Conclusion
In this section, the speaker concludes the tutorial.
Conclusion
- The containers have been successfully built and are now running.
- The WordPress installation page can be accessed at "localhost:8080".
- Any questions or doubts can be asked in the chat box.
Installing PHP My Admin
In this section, the speaker explains how to install PHP My Admin and access a MySQL database.
Steps for Installing PHP My Admin
- Open port 8181 for PHP My Admin
- Provide username as root and password as Eureka
- Access MySQL database using PHP My Admin
Conclusion
The speaker concludes the session by thanking the audience.