Monday, March 13, 2017

Making an IoT Project from Scratch : Intro - kerem izzet atam

I have been developing embedded projects since my university years to now. When i looked back i see that i have done so many projects and left them behind without documented. This is my first attempt to document my experiences on IoT projects. I will try to explain my approaches, methods and experience in my projects together with source codes and pretty much every technical details that i can provide. Hopefully i will finish this article series explaining every steps that i took by taking it from very beginning to end.

Sunday, March 05, 2017

Hands on Docker Tutorial : Running a Container with WordPress - kerem izzet atam

In this tutorial i will show my steps to install Docker on Ubuntu 14.04 and run container having WordPress on it. I have prepared this tutorial within my first attempt to try Docker so don't judge me for any miss leading parts.

I have been hearing mighty """Docker""" and its capabilities for a while but never dare to share time to read and learn so far. Today it was my first attempt to investigate as one of my colleague was talking about it again with such excitement. So i decided give a shot. As i am lazy person to read and excited person to try technologies i directly go into doing something... Lets run some server application (WordPresss) with Docker on my Ubuntu 14.04 machine.

Before we start let me tell how you might like Docker (as my friend's words) : "It runs like virtual machine but lot more light weight with container mechanism" and "You can search for different containers with different configurations and install it to your PC in seconds".

As i am lazy, selfish, solution oriented, so-called engineer, i ask "how is it useful for me?" So...

Is Docker useful for you?
  • Do you remember the time your efforts to prepare your development environment again and again each time you need to copy it other PCs; messing with all these tool chain installations, satisfying all those repository requirements and so on. 
  • Do you remember when you need to create independent environment variables for different projects and applications like php 5 for this php 7 for that.
  • Do you remember the time when you work with team overseas and you need to share same configurations to your colleague of your OS.
  • Do you remember your struggles to move your cloud server; re configuring all those configurations and facing same problems during installations.
If you remember, yes! Probably it will save your time as you will have very light weight version of your PC or server as container. You can keep those containers on cloud and install it whenever you want, like an application.


As summary of istructions on this official tutorial  :

1 - Clean if you have old versions of it : 

$ sudo apt-get remove docker docker-engine

2- Update and Install :

$ sudo apt-get update
$ sudo apt-get install \ linux-image-extra-$(uname -r) \ linux-image-extra-virtual

$ sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ software-properties-common

$ sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ software-properties-common

3- Verify finger prints :

$ curl -fsSL | sudo apt-key add -

Verify that the key fingerprint is 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88.
$ sudo apt-key fingerprint 0EBFCD88

pub   4096R/0EBFCD88 2017-02-22
      Key fingerprint = 9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
uid                  Docker Release (CE deb) 
sub   4096R/F273FCD8 2017-02-22
Done! Dockers is installed.

4- Now go to site : , Search for "WordPress" and click on detail of first result.

5- You will see page under this URL and check the command to command to pull this container as :
$ sudo pull wordpress

6- Run the container : 
$ sudo pull wordpress

7- Access to shell of container :
$ sudo docker run -it wordpress /bin/bash

8- Check running containers on host PC  :
$ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 0acccb9e18ce wordpress "docker-entrypoint..." 10 seconds ago Up 9 seconds 80/

9- Query IP of container by ID. We learn ID of our container from previous command as 0acccb9e18ce :
sudo docker inspect 0acccb9e18ce | grep "IPAddress"
            "SecondaryIPAddresses": null,
            "IPAddress": "",
                    "IPAddress": "",

10- Now i can browse through my WordPress container from IP ""

This tutorial is only for testing. Step 6 should be applied with command below according to instruction in WordPress. This will link our WordPress container with another container having mySQL. :
sudo docker run --name some-wordpress --link some-mysql:mysql -d wordpress

Kerem İzzet ATAM