# Elastic agent in a docker container TLS error

**URL:** <https://discuss.elastic.co/t/elastic-agent-in-a-docker-container-tls-error/280534>\
**Category:** Beats\
**Tags:** docker, elastic-agent\
**Created:** [August 5, 2021, 1:03pm UTC](https://discuss.elastic.co/t/elastic-agent-in-a-docker-container-tls-error/280534 "2021-08-05T13:03:57Z")\
**Posts on this page:** 4\
**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 5, 2021, 1:03pm UTC](https://discuss.elastic.co/t/elastic-agent-in-a-docker-container-tls-error/280534/1 "2021-08-05T13:03:57Z")

</div>

Good afternoon, I am trying to make a docker container with elastic-agent, packetbeat and metricbeat. I am going to add other components later however I want to get these working first. When I try to install elastic-agent with apt-get, I get a TLS error from the elastic repository. This doesnt happen with packetbeat or metricbeat. I assume that this error is simply caused by the repo not being correctly configured however some comformation would be nice.

Here is the dockerfile im using

```auto

FROM debian:latest

WORKDIR /usr/var

RUN apt-get update
RUN apt-get install wget gnupg -y
RUN wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -
RUN apt-get update
RUN apt-get install apt-transport-https -y
RUN echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-7.x.list
RUN apt-get update
RUN apt-get install elastic-agent packetbeat metricbeat -y

```

and here is the error message I recieve  
`Failed to fetch https://artifacts.elastic.co/packages/7.x/apt/pool/main/e/elastic-agent/elastic-agent-7.14.0-amd64.deb Could not handshake: The TLS connection was non-properly terminated.`

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [August 9, 2021, 8:06am UTC](https://discuss.elastic.co/t/elastic-agent-in-a-docker-container-tls-error/280534/2 "2021-08-09T08:06:53Z")

</div>

I just tried to build this Dockerfile on my machine and it worked. I wonder if this maybe was a temporary error? Could you try again?

---

<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 9, 2021, 8:19am UTC](https://discuss.elastic.co/t/elastic-agent-in-a-docker-container-tls-error/280534/3 "2021-08-09T08:19:20Z")

</div>

Good Morning,

It is now working for me also, it appears to have been a tempoary issue. 🙂

All the best

---

<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 6, 2021, 10:19am UTC](https://discuss.elastic.co/t/elastic-agent-in-a-docker-container-tls-error/280534/4 "2021-09-06T10:19:32Z")

</div>

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