# Elastic-agent in a docker container

**URL:** <https://discuss.elastic.co/t/elastic-agent-in-a-docker-container/281068>\
**Category:** Beats\
**Tags:** docker, elastic-agent\
**Created:** [August 11, 2021, 1:09pm UTC](https://discuss.elastic.co/t/elastic-agent-in-a-docker-container/281068 "2021-08-11T13:09:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NatSav](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@NatSav](https://discuss.elastic.co/u/NatSav)\
**Post date:** [August 11, 2021, 1:09pm UTC](https://discuss.elastic.co/t/elastic-agent-in-a-docker-container/281068/1 "2021-08-11T13:09:11Z")

</div>

Hi all.

Im trying to run an elastic-agent inside a docker container and im encountering a few issues. I know that docker isnt _technically_ supported however I think im nearly there and im going to persevere with it.

I have the elastic-agent (from the elastic repository) running atop of a debain image.

```auto
elastic-agent enroll -f --url={URL}:8220 --enrollment-token={TOKEN} --insecure --path.config=/etc/elastic-agent -v -e

```

successfully enrolls and makes the agent appear in fleet as `updating`.

```auto
service elastic-agent --full-restart

```

makes the agent go from `updating` to `unhealthy`

and this is as far as I have got.

No matter what I do,

```auto
elastic-agent status

```

returns  
`Error: failed to communicate with Elastic Agent daemon: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial unix /var/lib/elastic-agent/data/tmp/elastic-agent-control.sock: connect: no such file or directory"`

and

```auto
 elastic-agent inspect 

```

returns  
`no fleet config retrieved yet`

---

<div class="post-metadata">

**Author:** ![blaker](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/blaker/32/65621_2.png) [@blaker](https://discuss.elastic.co/u/blaker)\
**Post date:** [August 11, 2021, 1:20pm UTC](https://discuss.elastic.co/t/elastic-agent-in-a-docker-container/281068/2 "2021-08-11T13:20:49Z")

</div>

What you are doing inside of docker is not supported. You should use the supported Elastic Agent docker container.

> **[Run Elastic Agent in a container | Fleet User Guide \[master\] | Elastic](https://www.elastic.co/guide/en/fleet/master/elastic-agent-container.html)**

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 8, 2021, 3:21pm UTC](https://discuss.elastic.co/t/elastic-agent-in-a-docker-container/281068/3 "2021-09-08T15:21:35Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
