It was my first time to try Gitlab CI with docker runner configuration. The problem occurred when I tried to build an web application. I finally found the solution for it.
The error message was shown below.
I separated the gitlab CI installation with gitlab runner in different server. Let's say server A where gitlab CI is installed and server B where gitlab runner is installed and configured.
I thought the problem was caused because I hadn't installed docker on Server A. I installed docker on that server but the same problem kept occurring.
Then I had an idea to install docker as well in server B and voila it works. This was the solution!