Table of Contents
Table of Figures
This report includes the project details of my Project “Networking with Docker”. It contains the information about networking docker containers and publishing it to access it outside from the containers. Nevertheless, the report briefs about dealing with the containers and images in docker and how a network switch is used to expose the containers. With the increase of web applications, IoT and cloud platforms Docker has become a popular team for DevOps engineer to shorten the development life cycle. But creating Images and containers within the network is of little use as most of the servers will be in multiple location, publishing the containers will enable networks to access the application from multiple locations. With the architecture of microservices we can have thousands of services to host and manage as well as deployed, docker helps to make updates easier in multiple servers. For example, google.co.nz and google.co.in are hosted in different servers, if their APIs are in a docker container, it is easier to make any updates on the APIs. The report mainly focuses on the steps of implementing docker networks in Window Server 2016.It details the processes on installing Window server 2016 along with Docker to create containers on it using Hyper-V driver. Windows Command Prompt and PowerShell has been used to run the docker commands. It also explains the network ports that to be configured which publishing the docker container and how to link the docker machine port with the container port so as to establish a connection from outside the network. Containers are the way of virtualizing the operating system which allows you to run an application and its dependencies in an isolated process. It uses its own kernel and application layer.
If you need assistance with writing your essay, our professional essay writing service is here to help!Essay Writing Service
Manukau Institute of Technology (MIT) one for the highest ranked tertiary education providers in New Zealand that helps it students to achieve knowledge up to research level and preparing themselves to the job market in New Zealand and all over the world. The Digital Technologies division pave way for students in IT streams to get an overall knowledge of IT industry nevertheless enables to get in depth knowledge in their streams. The industrial project gives students an opportunity in solving challenging problems with specific tools and applying gained knowledge to help people and community.
The project was divided into mainly 3 tasks.
- Installing an operating system to configure docker machine.
- Create networks in docker containers.
- Publish the container.
The process was done first by, installing and configuring Windows Server 2016 (Hanson & Long, 2017). Later installing Docker (Cito, 2016)and executing commands to create Images and containers. It was followed by creating ports and mapping the ports to communicate with outside world. Finally publishing the container.
Docker is a useful technology that addresses the scalability and management problems by separating the applications and manage the infrastructure dependencies. It directs these issues with containers by allowing to set the applications with all their dependencies including the ports, meta data and structure of directories so that we can run our applications in the same way overall machines environment. Even though it can be achieved by virtual machines (Tozzi, 2019) also there are some distinct features that distinguish both, but overall container gives a virtual environment that to set the application processes and file system which is necessary for the application to run on the system. Most importantly applications do not need its own operating system with specifications or virtual machines to run.
The aim of the project is to understand the Docker and Container and learn how the Docker and Containers work with the window server 2016 desktop. Implementation of Docker and Containers and testing it in running mode to access the images and containers. Lastly publish a container and accessing it using the internet protocol address of docker machine (Docker, 2018).
In Docker by default, each container is isolated from other containers and from external network. Docker provides a bridge, but it must be configured to allow the containers to communicate with one another. It has always been a problem for network engineers and develops engineers to configure docker ports to access it. Even though Docker is the latest popular technology which is also a software environment where user can run application that is isolated from other application as well as the operating system, it needs right configuration and scripting to publish its ports.
Problem can be summarized as follow:
- How to make installation and configuration of a Server Operating System to serve as a platform for Docker.
- How to install Docker with its dependencies to create a virtual environment.
- How to create Images and containers within images.
- Managing the networking of container.
- Installation of apache webserver in a container.
- Publishing the webserver.
The window server containers is an environment where the application which has the registry that is the copy of their user mode data structure can be used to sharing the kernel and operating system with another window server container and other host operating system.but which copy it will be use that has its own file system and configueration of the networks. But in the hyper v container the environment of the application gives the kernel and operating system kernel isolation like the previous virtual machines.
We can deploy the windows containers on the window server 2016 with the experience of the desktop. Even though it can be deployed on both physical and virtual machines, I have deployed the window server containers on my physical machine with the following steps.
- Firstly, I have installed window server 2016 on the physical machine.
- Secondly, I have installed Docker on the window server 2016 from docker hub.
- Install the container on the window server 2016.
- Enable hyper-visor on it.
- After that manage the networking of containers and resources.
- Use the PowerShell and Docker demon to run the commands to managing the containers.
- Install the apache webserver to access the it from outside the docker machine.
- Manage the container networking.
- Run the Powershell commands for mapping ports, exposing ports and linking the containers.
- At the first I have installed docker on the window server 2016.
- Then create an image in the docker hub using powershell command.
- Create container on the Docker.
- After creating the container, we can expose the port.
- Any file, folder, like images we access these from the outside using another software like apache and ubuntu.
- We can expose the port number at that level where the container will pay attention like we can exit from the container the containers should be run at that time.
- The most important thing is that the Docker ID and Docker user name should be set to run the images on the Docker.
- When we run the Docker then we use the basic image to start the make new image.
There are some steps which is necessary to implement the containers on window server 2016 with the experience of desktop in the same way one can install the feature of container on the server with desktop. For the access of these container one can use of tool command line that also can be used for the installation of window server 2016. First and most important thing to install the container feature that you have to knowledge about the using powershell. Also, we know that after installation of the container we have to add the restart option. If anyone deployed Hyper-V container and the container deployed in the virtual machine then they need firstly install the Hyper-V role on the server. for the restarting of server after installation of the container we will follow this command:
Install-WindowsFeature containers -restart
Docker is a platform where it uses by the architecture of client-server and there client meet to the Docker daemon. because this daemon provides the all services to the Docker. However, the daemon provides the various components that helps in the toolsets which ,manage the allover workflow and deployed system in the containers. On this platform we meet all the necessary requirements of the Docker’s ecosystem and we have success to complete whole Docker ecosystem. Docker has an open platform which helps to run,Develop and shipping the all their application in the lightly isolated environment that is called container.Docker is a kind of platform which helps you to quickly deliver your software because it enable to separate the application from the infrastructure. Docker is only the platform where you can manage your application as your infrastructure. Also the isolation and security of the docker allow to run different containers in a same time on the provided host. Containers can run straightly with hosting machine’s kernel therefore they are very light weighted and no need for the much load of the hyper visor.
Docker engine known as a client server application with their major components as the engine has ability to accept different configuration like below:
- Incoming requests accepted by the daemon’s configuration.
- Configuration of log and debug setting.
- Docker engine configured the default networking setting.
All above settings are defined in a configuration file by the Window services control manager.This file is preferred in c:ProgramDatadockerconfigdaemon.json.we can add required changes in a file. With the help of docker you can accept incoming connection on port by use the configuration of file setting. when you try to modify the dicker services on Docker engine by use Sc config. At that time the Docker engine flags are set directly on the Docker Service. The following command can run on the command prompt which is accept incoming connection on port:
Sc config docker binpath = “c”:program filesdockerdockered.exe”—run -service -H tcp://
If we talk about the virtual machines it has independent system that contain their self-operating system that is known as guest operating system.
In the physical machine we need to install one layer on the top of the OS system that is called hyper-visor and multiple virtual machines on every host. Also, hyper visor called hyper visor 2 that work as proxy for the hardware that indicate to guest operating system to run their dedicated system hardware. Functions and components of virtual machine is as follows:
- Virtual machine has isolation from the security and enough resources to use so that the virtual machine acts like separate system.
- It can be stored only single file that will be easily assisted up from another resource as requirement.
Dockers works as open source it helps to use Containers as very easiest, more portable because it gives them popularity with their work. We can implement number of services that allow the containers to work very flexible and movable. We can easily run, send, copy and create services as containers. There are many drawbacks during use of the virtual machine so it can be reduced by the latest use of the Docker and Containers because it has some specialty is as following:
- When the containers are used in the LXC and it moved from one host operating system to another it followed the different server configuration that why it has not running smoothly.
- Now Docker is ensuring for the portability of the container because it intangible the operating system, their networking also storage for the application.
- For the Docker we need external storage they will not be support the existence storage.
Docker follows the Architecture of Client server. In the docker daemon, they deliver the and distribute and running service to the container. The Docker concentrate on the API requests and try to manage their objects like containers, networks, volumes and images. It can be communicating with other daemons to achieve docker services. On the other side the Docker and the client of the Docker can run on the system at the same time.
Docker Daemon is existing on the docker system to be able to manage containers which is running on the host machine.
Container is a system that is required for the running process it contains the files, folders, processes, ports that can be mandatory for the run application on the host system. Although the ports are available on the containers but without the Docker we can’t mapping of that ports.
The Docker clients is work as interface even on the Command prompt for the purpose to Communicate with Docker Daemon. Many users can be interacting with the Docker Daemon because it is the key method during the use of command the client send these command message to the Docker with API then they will be transfer them out. Users can Communicate at the same time one or more daemon.
It is the File of Docker and Containers that can be read only and as well as can be Share and move. if you desired to check the changes in the different two images so you can be run this command docker diff. these images have various layers. If users want to create your own images firstly they must make Docker file. They can change this docker file and recreate the image but use only that layer which they recreate. This method makes the Docker images as very light weight and running fastly. This all process have meaning firstly deploy and send you new layer to make them faster.
If someone use the Docker services then it is very important to register on the Docker. You can create you own private registry in the Docker organization. This is kind of repository that is use for storing and sharing the images that is deployed by Docker containers. Actually, the docker hub is the registry of Docker that permit you to pull and push the images in the container. you can access it as public and private. DDC and DTR is the Docker’s registry. That id defined as data center and docker trusted registry.
Docker has filesystem that can be operate by created layers.it is called also US files that is used by Docker engine. These files provided the building blocks in the containers.
This is the platform where you can typed the commands for build the Docker images. For installing Software user can set the instructions and variables in the docker environment. User can add new code when they are using the docker commands. User can set the instructions.
Swarm is the tool it is used for the Docker machine. It can be install manually with the Swarm images ant it will be separate but with the help of this tool Docker nodes work as big Docker Host. Also, it is used to instruct the Containers to start and it has decided which docker nodes has started to the containers.it will not show the complexity.
Docker machine is use to turn on Docker hosts on the local device. User can manage the them with the commands like Start, Stop and run etc. This provides multiple services.
The Docker services can easily use by install in Docker Swarm manager. It will be start and run the containers.it will dynamically configured on the Docker machine. We can find out the discovery services that will be load and manage and it will be work as developed Docker engine. we can use in it command. The services will be very lightweight, and portable.
Docker has composed tool that permit to user to describe and run multiple application. Also, user define the applications in the Docker.yml file this command is run to automatically turn on the needed container as depend on the instruction. Moreover, user can be define the docker application in the only one docker file. With the compose command user can be manage the application services in a Docker file. The most important thing of this is that the tool is use for run that application which is run the multiple container. This includes that architecture which is meet to the Docker Daemon this Daemon helps to provide the all services at their own base. In the Docker container one can sore the data by their own Created storage. They can easily pull and push their storage data in the form of images. These Containers run in one way so user can make them work together.
As we know that Images are set of layers, we can create new images with the use of commands it will help to Create final images we can reuse these built images in the Docker. Likewise, when we built an image on the top of the apache that has name First image and we want to create this image again on the Apache with running on ubuntu. We can reuse that image again this file will reuse the all layers of first image expect their name because we are creating the image that has name Second image. Hence that, these two images using the same layers of ubuntu and apache. When we reuse this image, this will be makes very fast, but it will be reduce its size. Every Image its own file layer. This step differentiates it from both images.
Our academic experts are ready and waiting to assist with any writing project you may have. From simple essay plans, through to full dissertations, you can guarantee we have a service perfectly matched to your needs.View our services
I have installed window server 2016 on my laptop which has also Window 10 operating systeFirstly I have change the UEFI that will not support the dual system, so we need to change legacy bios boot mode after that you can change the MBR to GPT that is the way to store portioning information. Windows only can boot from GPT on UEFI based computers. When we successfully installed Docker on it then we can install docker on it. On the other side you can install window server 2016 with the bootable USB. First you have make your USB bootable and then you can install on your Physical machine.
Docker is software that has open source environment that is used in the Linux for the implementation of containers from many years. But after some time, Microsoft adapted the Docker software for the windows. Now a time, Docker become a part of the window environment, therefore we can’t be installed Docker as Feature and role or therefore we must install powershell. we have some cmdlets for this package I as follows:
- Install-Module Dockermsftprovider -repositary PS Gallery -Force
- Install-Package Docker -Provider Name DockerMsft Provider Firstly we have typed first command then the message will ask for your trust on the package of Docker Default then you can be enable to entered the second another command. We can give our respond with y in two commands.
- After that we need for restart the computer.
- the machine get started then you might be confirmed that you service is running with task manager.
- Service is representing by dockered.exe file which is install with Docker package.
When run the PowerShell commands after installing the docker and containers on the window server 2016 this command will be show the version of the Docker. The command is as shown:
Docker — version
There are two containers are run on the Docker that is show in the above picture. First is nginx and the another one is the Ubuntu. The command is used in it docker ps -a. As well it shows the Docker name we can find that with this command.
Docker run hello -world command is use to run the image in container but it will not available locally it will push from the Docker Hub.
In the below picture we can see that the images available in the repository system. We can built the images and reuse it. These images are very lightweight, and also it can be read on template of file. User can ship and deployed the images. Every image has its own layer. We can search the images in the repository system using this command docker images.
Docker ps command use to search the running containers is shown in below figure:
In this figure it can be see there are one another new picture which I have created with the name preet Which is not showing in another images figure.
This Image showing the Ubuntu ID that is in the repositery system.
This ubuntu id can be access and run the hello world.
In the above I have exec and run the id of ubuntu image within container and it show the heloo world. Here I have used command : Exec -it ubuntu id.
A virtual switch allows virtual machines created on Hyper-V hosts to communicate with other computers. The default docker switch is avilable in internal network only,to get a external network switch in hyper-v we need to create a switch.for the project we have created a switch named Primary Virtual switch.
docker-machine create -d hyperv default
A docker machine is create with the hyper-v driver with the above command.
docker-machine env –shell cmd default
FOR /f “tokens=*” %i IN (‘docker-machine env –shell cmd default’) DO %i
The created docker machine should make active so as to create images and containers.The above commands helps to make active environment for the machine.
7.15 Create a Container “webserver” with ubuntu as Image and mapping port 80 of the container with port 80 of docker machine and List the Container
docker run -td –name webserver -p 80:80 ubuntu
A container is created with the name webserver and port 80 of the container is mapped with port 80 of the docker machine.
docker port webserver
docker exec -it webserver /bin/bash
The container source is updated to get the latest version.
apt-get install apache2 vim
This command helps to install apache server in the newly created webserver container also vim is installed for editing purposes.
The webserver is restarted so as to incorporate the changes.
docker-machine ip default
The machines ip address is verified so as to access the container port.
Figure 17:Docker machine ip address
- How to use docker engine.
- Information about docker container images.
- How to push and pull container images .
- How to expose a port.
- How to publish default html page.
- How to edit files within containers and access it from outside.
- Difficulty in installing and configuring windows server 2016.
- Difficulty in running docker commands which are Linux based.
- Containers exiting immediately.
- Less online resources and discussions on Docker.
Summary of Phase
Planning and Resource Collection.
Install Windows server 2016
Installation of Docker Engine.
Create a Hyper-V port
Pull images from Docker Hub.
Own Container Image.
Access ports from outside.
Checking whether ports can be accessed with docker machine ip address
Accessed default page of Apache server and created test file with “hello world”
The project has been completed and has have concluded that Docker Container port can be exposed and published to access from outside, by publishing the ubuntu webserver container and accessing it using the ip address of the docker machine. Also the default page of the webserver has been changed by editing the html page using vim editor.
The primary function of docker containers is to run applications so that multiple sources can access it from multiple location, to achieve the aim a network engineer or a docker expert need to configure ports. In the process of doing it they will come across a series of configuration settings along with docker commands to accomplish so. This project has provided the basic steps to attain the port publishing in docker, nevertheless the research points out the need to publish containers to access it in a network. The project has concluded that the docker networking is possible and with the help of it network administrators can be solution providers of many of the blockades in implementing different application. Docker has been adopted by many companies including Microsoft who are investing heavy for the vast possibilities of Docker, and this project has helped me in understanding how the docker works and the architecture of docker, and developing a network with docker containers.
- Cito, J. &. (2016). Using Docker Containers to Improve Reproducibility in Software and Web Engineering Research. doi:10.1007/978-3-319-38791-8_58
- Docker. (2018). Publish and expose service or container ports. Retrieved from https://docs.docker.com/v17.12/docker-cloud/apps/ports/
- Hanson, S., & Long, J. (2017). Installation and Configuration of a Windows Server 2016 Domain Controller. MOREnet Annual Conference.
- Tozzi, C. (2019). The Differences Between Linux and Windows Containers. Containerjournal. Retrieved from https://containerjournal.com/2019/04/03/the-differences-between-linux-and-windows-containers/
Cite This Work
To export a reference to this article please select a referencing stye below:
Related ServicesView all
DMCA / Removal Request
If you are the original writer of this essay and no longer wish to have your work published on UKEssays.com then please: