April 5, 2017

Docker for Beginner, Install Docker on Ubuntu 16.10 Yakkety Yak

Docker is a new application can makes easy and simple to run image os, application or other service application in an small container. Docker combined like a virtual machine running inside computer or server, with a little bit proccess usage, portable and dependent by operating system host.

Docker have two metods for running Docker on ubuntu 16.10. First method is installing docker on existing installation running on operating system. Second, with spinning up server with docker tool the developer called Docker Machine.

In this article, we will give an example of installation process on ubntu 16.10. 

Install Docker From Repository

Docker Installation packer supported by Ubuntu 16.10 Official, but not be the latest version. To install the latest docker set ubuntu repository with docker repository

But first, let's update the package database:

sudo apt-get update
Now let's install Docker. Add the GPG key for the official Docker repository to the system:

sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

Add the Docker repository to APT sources:

sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-yakkety main'

Verify the Docker repo instead of the default Ubuntu 16.10 repo:

apt-cache policy docker-engine
Verify Docker Repo

Finally, install Docker:

sudo apt-get install -y docker-engine

Verify Docker Running status

sudo systemctl status docker
Docker Service Status

You can search for images available on Docker Hub by using the docker command with the search subcommand. For example, to search for the Ubuntu image, type:

docker search ubuntu
Docker Search Ubuntu

By Typing command docker search ubuntu, we get all of the information about container with name ubuntu, choose the package what you want and what you need.  
Docker pull ubuntu
Docker Pull Ubuntu

To Install docker container like ubuntu images, type the install command with pull, for example docker pull ubuntu. Its mean we install ubuntu container. after this, using docker run ubuntu or docker run -it ubuntu for running ubuntu images as docker container.

Related Article : Bash On Ubuntu on Windows

Check The IP address of Docker Container 

Docker install apache and get IP address
Docker IP Address

We test to install apache server on ubuntu container, using normal command apt-get install apache2, and start apache service. We got an information about IP Address of ubuntu image. Dokcer using NAT to access container.

Test Apache 

Test Apache Service

We test the container ubuntu images for running apache web server using web browser and access it by ip address. 

Docker Stop

Docker Stoped

For stopping the container, user exit command, automatically the container will be stoped and cannot be access. 

Service Apache stop

Service Apache Stop

This is a simple way learning about docker, if you want install some service or aoplication, you can search in docker repository. Docker very usefully for system admin to create a test environment and team developer too.
Previous Post
Next Post

post written by: