# Serverless + Docker CI/CD Build Error

**URL:** <https://forum.serverless.com/t/serverless-docker-ci-cd-build-error/18241>\
**Category:** Serverless Framework\
**Tags:** aws, fargate\
**Created:** [January 26, 2023, 4:06pm UTC](https://forum.serverless.com/t/serverless-docker-ci-cd-build-error/18241 "2023-01-26T16:06:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![robertsamarji](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/robertsamarji/32/5412_2.png) [@robertsamarji](https://forum.serverless.com/u/robertsamarji)\
**Post date:** [January 26, 2023, 4:06pm UTC](https://forum.serverless.com/t/serverless-docker-ci-cd-build-error/18241/1 "2023-01-26T16:06:00Z")

</div>

Hello,

I’m attempting to schedule a long running task.

To do so, I’m using the `serverless-fargate` plugin to add an image to AWS ECR (Elastic Container Registry) to then be spun up by AWS Fargate.

I am deploying my Serverless app via the CI/DS integration. However, I’m getting the following error during the Serverless build:

```auto
Encountered error during executing: docker build -t serverless-nameofservice-dev:nameoftask -f /path/to/Dockerfile path/to
Output of the command:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

```

The relevant parts of my serverles.yml look like this:

```auto
provider:
    ecr:
    images:
      nameoftask:
        path: path/to/
        file: Dockerfile

  fargate:
  vpc:
    securityGroupIds:
      - sg-id
    subnetIds:
      - subnet-id1
      - subnet-id2
      - subnet-id3
  tasks:
    service:
      image: nameoftask

```

The Dockerfile looks like:

```auto
FROM node:18-alpine
WORKDIR /usr/app
COPY ./ ./
RUN npm install
ENTRYPOINT ["node"]
CMD ["app.js"]

```

My Serverless framework version is v2.66.2

I suspect the issue is that Docker containers are not supported by Serverless CI/CD.

Does anyone know why this error might be occurring and how to fix it?

---

<div class="post-metadata">

**Author:** ![mikkelAtVisma](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/mikkelatvisma/32/7415_2.png) [@mikkelAtVisma](https://forum.serverless.com/u/mikkelAtVisma)\
**Post date:** [April 4, 2023, 10:49am UTC](https://forum.serverless.com/t/serverless-docker-ci-cd-build-error/18241/2 "2023-04-04T10:49:45Z")

</div>

Hi, you would firstly need to install Docker into the service that is running serverless.

If you’re using a docker image itself to do this, we had an issue where we resolved the error by adding:

```
volumes:
  - /var/run/docker.sock:/var/run/docker.sock

```

To our docker compose file.
