# Docker build error: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

**URL:** <https://discuss.circleci.com/t/docker-build-error-cannot-connect-to-the-docker-daemon-at-unix-var-run-docker-sock-is-the-docker-daemon-running/41049>\
**Category:** Build Environment\
**Created:** [August 25, 2021, 2:55am UTC](https://discuss.circleci.com/t/docker-build-error-cannot-connect-to-the-docker-daemon-at-unix-var-run-docker-sock-is-the-docker-daemon-running/41049 "2021-08-25T02:55:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ucals](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/ucals/32/25845_2.png) [@ucals](https://discuss.circleci.com/u/ucals)\
**Post date:** [August 25, 2021, 2:55am UTC](https://discuss.circleci.com/t/docker-build-error-cannot-connect-to-the-docker-daemon-at-unix-var-run-docker-sock-is-the-docker-daemon-running/41049/1 "2021-08-25T02:55:35Z")

</div>

Hi all,  
I need a simple solution to build a docker image, push it to ECR, and deploy it to ECS.

The final part, which deploys the ECR image to ECS is working. (I’m using a `deploy.py` short script that uses Python’s AWS boto3 SDK, found it easier than making the ECS Orb work…)

However, I’m struggling with the first part, need help. I just need to automate the simple `docker build`, `docker tag` and `docker push`. It’s very simple, but I don’t know what I’m doing wrong.

Can anyone help me? It follows the code, I’m running it locally for debug purposes:

```auto
version: '2.1'
jobs:
  build:
    docker:
      - image: cimg/python:3.8 
    environment:
      AWS_ACCESS_KEY_ID: yadayadayada
      AWS_SECRET_ACCESS_KEY: yadayadayada
      AWS_DEFAULT_REGION: yadayadayada
    steps:
      - checkout
      - run: |
          docker build -t myimg .
          docker tag myimg:latest asdf.dkr.ecr.asdf.amazonaws.com/asddf:latest
          docker push asdf.dkr.ecr.asdf.amazonaws.com/asdf:latest
          
          pip install boto3
          python deploy.py

```

Learnign CircleCI is really frustrating, no good resources for beginners…

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![FelicianoTech](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/felicianotech/32/21348_2.png) [@FelicianoTech](https://discuss.circleci.com/u/FelicianoTech)\
**Post date:** [August 27, 2021, 6:26am UTC](https://discuss.circleci.com/t/docker-build-error-cannot-connect-to-the-docker-daemon-at-unix-var-run-docker-sock-is-the-docker-daemon-running/41049/2 "2021-08-27T06:26:22Z")

</div>

I just wanted to close the loop here. This was answered [over on StackOverflow](https://stackoverflow.com/a/68922177/1195276).
