Docker – Introduction

Docker Introduction Docker is a software container platform. It is an open platform for developing, shipping, and running applications. A Docker container wraps all the software components to run an application. Using Docker you can provide an isolated environment for your every individual application. Docker Engine “Docker Engine” is the core of Docker which creates, ship and runs Docker containers. Docker Engine provides client-server application architecture with the following major components. A server daemon process for continuous running. The REST API to talk to the daemon and send instruction to…

Read More

Docker – Compose

Docker Compose Docker Compose is another best tool for docker to setup multi-container environments. Using this create a single compose file with defining all the containers with there environments. You can easily use single command to build images and run all the containers. There is the three-step process to work with Docker Compose. 1. Define application environment with Dockerfile for all services. 2. Create a docker-compose.yml file defining with all services under application. 3. Run docker-compose up to run all services under applications. You must have Docker Engine installed on…

Read More

Docker – Networking Example

Docker Networking Example As you already read our previous tutorial Docker Networking. This tutorial, we will create a small docker network with 2 docker containers as following. > MySQL – A relational database server. > PHPMyAdmin – A web based interface to manage MySQL server. In this tutorial, you will learn how to access MySQL server using PHPMyAdmin running on the different container. 1. Create Network First of all, create a new docker network. Use below command to create new bridge network named my-bridge-network. $ docker network create -d bridge…

Read More

Docker – Networking

Docker Networking Docker provides an option to create and manage there own network for networking between docker containers. Use docker network subcommand to manage the Docker networking. Syntax: docker network [options] Use below tutorial to create, list and manage Docker networking. List Docker Networks Use ls option with docker network command to list currently available network on the docker host. docker network ls Create Docker Network Docker provides multiple types of network. Below command will create a bridge network on your system. Syntax: docker network create -d [network_type] [network_name] Example:…

Read More

Docker – Installation

Docker Installation We have prepared tutorials for advance docker installation. Use links to get access for docker installation. > Install Docker on CentOS, RedHat & Fedora > Install Docker on Ubuntu & Debian To install docker from default repositories follow this tutorial. #1. Requirements Docker required 64-bit operating system with Kernel >= 3.10. Older versions of Kernel have some missing requirements to run all features of Docker. $ uname -r 4.4.0-92-generic #2. Install Docker Docker is available under default repositories of Latest Linux systems. You simply install them using package…

Read More

Docker – Manage Ports

Manage Ports in Docker The Docker containers run services inside it on a specific port. To access that services of container running on a port, You need to bind container port with some Docker host port. Example 1 Have a look at below image. You will see that docker host is running two containers, one is running Apache which has some website and other have MySQL. Now, you need to access the website running on Apache container on port 80. Let’s bind docker host port 8080 to containers port 80.…

Read More

Docker – Dockerfile Directives

What are Dockerfile Directives In our previous tutorial, you learned how to build images with Dockerfile. This tutorial will help you to understand the basic Dockerfile directives and there uses. FROM The from directive is used to set base image for the subsequent instructions. A Dockerfile must have FROM directive with valid image name as the first instruction. Examples: FROM ubuntu FROM tecadmin/ubuntu-ssh:16.04 LABEL Using label you can organize images in a proper way. this is useful to set maintainer address, vender name, version of image, release date etc. The…

Read More

Docker – Dockerfile

Working with Dockerfile Dockerfile is a file used to build images by reading instructions from a file. The default name is used as Dockerfile. You can create dockerfile in the current directory with specific instructions and build a customized image as per your requirements. Build Image with Dockerfile As a best practice, the Dockerfile is called Dockerfile and located in the root of the context. You can use the following command to build docker image. This will read Dockerfile in the current directory. $ docker build -t image_name . You…

Read More

Docker – Data Volumes

Docker Data Volumes In docker, data volumes are useful for managing your data with Docker containers and host machines. Here you will find two way of managing data volumes on Docker containers. Using the data volume container. Using share data between the host and the Docker container #1. Use Docker Data Volume Container The Docker data volume container is same as other containers, but they just used for storage only. You can use storage of these containers to your containers. When you write data to your containers file system, it…

Read More

Docker – Container

Docker Container Docker container is a running instance of an image. A container combined only libraries and settings required to make the application work. It is the lightweight and portable encapsulated environment for an application. Run Docker Container Use docker run command to launch a Docker container on your system. For example below command will create a Docker container from the hello-world image. docker run hello-world Now create a real instance of Docker container using CentOS operating system. The option -it will provide an interactive session with pseudo-TTY enabled. This…

Read More