Skip to main content

Docker Architecture

Docker Architecture 

Docker is client-server  type architecture-d application where the docker client initiate request to Docker Server which is a daemon process . The server process the request for which it does various activities like : building, storing, running various containers. It also helps to setup network .
Client talks to daemon using REST APIs over the network 

The server and client could be on same or different machine. 


                                  Docker Architecture Image ( source docker official site)

Docker Client : It runs command using CLI or script and using API layer  it passes those command to Docker server. Some example of such command is : 
 docker ps 
docker images 
docker build
docker run

Docker Server : Docker server listens to  API requests and acts on those. Based on those requests it manages the objects like : Images, Networks, Containers and Storage. 


Docker Registry : As the name suggests, it stores the docker images which can be pulled as a ready to run application . After building an application, docker server creates the images which can be stored in registry for reuse which saves a lot of time. There are two types of registry : Public and Private 

Public registry is Docker Hub which hosts a lot of images uploaded by various users . Those are ready to use and can be accessed by anyone having docker hub account. A lot of open source software are already available as image in docker hub which can be pulled with a command and can be used for your purpose. 

Private Registry : As there are software which are private to an enterprise . For that a private repository can be created . 

Comments

Popular posts from this blog

Install Docker on EC2

1) Launch EC2 instance , the one with docker support on it  2) Then follow simple below 4 instructions   Update yum for any package  The install docker  then start the docker service  register the ec2-user in docker sudo group to execute commands without sudo permission  a) sudo yum update -y  b)  sudo yum install -y docker c)  sudo service docker start d)  sudo usermod -a -G docker ec2-user you can verify the  docker installation by running some sample docker commands like  docker image ls  docker ps  reboot the system to take an effect of sudo group

Installing Jenkins on RedHat on AWS EC2

1) Create an EC2 Instance from the aws amazon.com UI with basic free tier configuration and select RedHat AMI 2) Generate KeyPair if its not already generated 3) Store the key-pair in secure location in your system and change its permission to 400 which means only the owner can utilize it  4) I'm using windows wsl , so it did not let me modify the permission in the download directory so I copied the file in linux direcotry ( /home/<username>/) and then changed its permission using chmod sudo chmod 400 myec2login.pem 5) Then I logged in to my ec2 instance using ec2-user which is default user for ec2 instances providing the path of this file  ssh -i "/path/to/ec2pemFile" ec2-user@ec2IPaddress 6) First installed the java version 8 on the instance as Jenkins needs java 8 run time sudo yum install java-1.8.0-openjdk-devel.x86_64 In case there was already a different version of java available, you have to run alternative config command on linux to select this version to ...

Quick Sample Docker Java Application Demo

A quick demo for Java Application container In this page, I'll show you a demo to quickly build an image and run a docker container.  To run this you must have a docker installed .  I'm going to use this on Ubuntu/Linux On windows subsystem.  1) You can create a directory for this demo using linux command    mkdir docker-demo-java 2) Change directory to new folder using cd command as cd docker-demo-java 3) create a sample java file DemoJavaContainer.java and print a sample message as "A sample docker java application demo" class DemoJavaContainer{ public static void main(String ar[]) { System.out.println("A sample docker java application demo"); } } 4) Then write a sample docker file named Dockerfile and write the below content from java:8 COPY . /var/java WORKDIR /var/java RUN javac DemoJavaContainer.java CMD ["java","DemoJavaContainer"] 5) save the file in the project directory 6) run command : docker build -t sample-docker-java-...