GitLab pipeline stop at the stage of pulling an image from Docker hub Description:
I have created a test project to serve a simple HTML page with httpd:alpine image. The following are the parts of the repository:
index.html:
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;title&gt;Rostami test page&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;h1&gt;Hey guys!&lt;/h1&gt;
&lt;/body&gt;
&lt;/html&gt;

Dockerfile:
FROM httpd:alpine

COPY ./ /usr/local/apache2/htdocs/

docker-compose.yml:
version '2.2'

services:
  myhtml:
  image: html_mrt:latest
  ports:
  - &quot;9999:80&quot;
  restart: on-failure
  container_name: HTML_Rostami

.gitlab-ci.yml:
stages:
  - build
  - deploy

build:
  stage: build
  script:
  - docker build -t html_mrt .
  tags:
  - docker

deploy:
  stage: deploy
  script:
  - docker-compose up -d
  - docker rmi $(docker image -q filter &quot;dangling=true&quot;)
  tags:
    - docker


Issue:
In addition, when I execute gitlab-runner status on the GitLab-Runner container, it says:
Runtime platform                                    arch=amd64 os=linux pid=79 revision=a998cacd version=13.2.2
gitlab-runner: Service is not running.

I've tried to start the service by gitlab-runner start but nothing has affected.

Problem:
It's the log of the build stage:
Running with gitlab-runner 13.2.2 (a998cacd)
  on Test K-1ZsHyF
Preparing the &quot;docker&quot; executor
00:11

Using Docker executor with image docker ...
Pulling docker image docker ...
Using docker image sha256:81f5749c9058a7284e6acd8e126f2b882765a17b9ead14422b51cde1a110b85c for docker ...
Preparing environment
00:02

Running on runner-k-1zshyf-project-1-concurrent-0 via 806fd175c866...
Getting source from Git repository
00:03

Fetching changes with git depth set to 50...
Reinitialized existing Git repository in /builds/m.rostami/test/.git/
Checking out 82d339a9 as master...
Skipping Git submodules setup
Executing &quot;step_script&quot; stage of the job script
00:04

$ docker build -t html_mrt .
time=&quot;2020-08-18T06:36:52Z&quot; level=error msg=&quot;Can't add file /builds/m.rostami/test/docker-compose.yml to tar: io: read/write on closed pipe&quot;
time=&quot;2020-08-18T06:36:52Z&quot; level=error msg=&quot;Can't close tar writer: io: read/write on closed pipe&quot;
error during connect: Post http://docker:2375/v1.40/build?buildargs=%7B%7D&amp;cachefrom=%5B%5D&amp;cgroupparent=&amp;cpuperiod=0&amp;cpuquota=0&amp;cpusetcpus=&amp;cpusetmems=&amp;cpushares=0&amp;dockerfile=Dockerfile&amp;labels=%7B%7D&amp;memory=0&amp;memswap=0&amp;networkmode=default&amp;rm=1&amp;session=8jgar93piqxu2s7y5yp9w2wtg&amp;shmsize=0&amp;t=html_mrt&amp;target=&amp;ulimits=null&amp;version=1: dial tcp: lookup docker on 192.168.1.1:53: no such host
ERROR: Job failed: exit code 1

192.168.1.1 is the default gateway and nameserver of the host that the Docker daemon is running.
How to fix the problem?
Thanks in advance.
I image you have used the dockerExecutor in gitlab-runner. This means you try to use docker-in-docker.
https://docs.gitlab.com/ee/ci/docker/using_docker_build.html
I suggest to configure the docker socket binding which might be less secure but very easy to handle.
To register a runner with docker-in-docker support mount the /var/run/docker.sock:/var/run/docker.sock
e.g.
sudo gitlab-runner register -n \
  --url https://gitlab.com/ \
  --registration-token REGISTRATION_TOKEN \
  --executor docker \
  --description &quot;My Docker Runner&quot; \
  --docker-image &quot;docker:19.03.12&quot; \
  --docker-volumes /var/run/docker.sock:/var/run/docker.sock