Docker Build a Ubuntu Image

In the previous article, I showed you how to install Docker and clone first image to local machine. So now, I will show you how to push a Ubuntu image to Docker Repository

It’s not about “having” time. It’s about making time


At first, please make sure that you had a account at (if not, please create one, it is free)

Lets start with Docker Login command in local machine:

For example, you need build a Ubuntu image that contains Apache2 web server. You create a Docker build file firstly.

Add content below to Docker build file:

Run build a Docker Ubuntu Image:

And test and install some packet if you want:

Finnaly, commit & push your Ubuntu Image to your Docker Repository:

Note:  thanhson1085/webserver was created in your repositories at

That is all, love Docker at the first eye.


LVM remove physical volume

This article will show you the way to remove physical volume from logical volume group. The scenario as below:

Your machine have volume group named sonnst-vg. This group contains two physical volumes: sda5 and sdb1. And now, you want to remove sdb1 from sonnst-vg. See the details with lvdisplay command:

You should pay attention to “Physical extents 0 to 20478”. To remove, you use command lvreduce as below:

(Before try this command, please backup everything in your disk :))

Please note that number 20479 is calculated by 20478 + 1

Test the result with lvdisplay:

Reboot for now.

Install Docker in Ubuntu 14.04

Docker is a platform of developer and sysadmins .  With Docker, you will be able to push whole your virtual machines  to cloud.  So you could easily use it everywhere and every time, or share to other people. I will share you the details of Docker installation in Ubuntu 14.04

Install Docker via apt-get:

Run bash completion:

Install Apt Transport Https:

Then, add the Docker repository key to your local keychain.

Open /etc/apt/sources.list.d/docker.list and add text:

And now, install lxc-docker package:




Apache Thrift Hello World with PHP and Python Part 2

In the previous post – Apache Thrift Hello World with PHP and Python Part 1, I wrote how to code server python with Apache Thrift. And, the second part, and it is the last one as well, I will show you the way how to writing the client with Laravel 4.2

You could clone full source from here:

Please download the source code before reading next steps.


What you get by achieving your goals is not nearly as important as what you become by achieving your goals

Step 1: Add Apache Thrift client libraries to Laravel

Create directory: app/libs

Add put all external libraries to that directory.

Includes libraries to Laravel autoload by adding the lib path to composer.json file:

And run composer update :

Step 2: Add a route

Add routes (app/routes.php):

Step 3: Create Hello Controller

Laravel HelloController (HelloController.php):

With source code above, You can see that thrift client will be connect to server at port 9093, localhost, and timeout is 3600 seconds.

Step 4: Run a Test

Run Thrift Server (refer to part 1):

Run client request: