# Dockerfile x HostGroup

**URL:** <https://community.dynatrace.com/t/dockerfile-x-hostgroup/33256>\
**Category:** Open Q&A\
**Tags:** hosts-classic, docker\
**Created:** [November 11, 2021, 3:23pm UTC](https://community.dynatrace.com/t/dockerfile-x-hostgroup/33256 "2021-11-11T15:23:33Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![RodrigoBiaggio](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/rodrigobiaggio/32/39343_2.png) [@RodrigoBiaggio](https://community.dynatrace.com/u/RodrigoBiaggio)\
**Post date:** [November 11, 2021, 3:23pm UTC](https://community.dynatrace.com/t/dockerfile-x-hostgroup/33256/1 "2021-11-11T15:23:33Z")

</div>

I have several fargate aws tasks in the environment. None of them have a host group configured. I’m trying to set --set-host-group inside my docker file, to make the deploy/run image with this information, but it’s not working.

I made some tests, passing the parameter inside of entrypoint and inside of command (Tasks definition), none of them worked.

I spoke to chat and they told me it is not supported, or because I cannot set the host group of my AWS fargates tasks. Is correct?

If yes, does not have any workaround for this?

---

<div class="post-metadata">

**Author:** ![abraham\_villega](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/abraham_villega/32/14460_2.png) [@abraham\_villega](https://community.dynatrace.com/u/abraham_villega)\
**Post date:** [November 11, 2021, 4:07pm UTC](https://community.dynatrace.com/t/dockerfile-x-hostgroup/33256/2 "2021-11-11T16:07:13Z")

</div>

Hi Rodrigo,

Setting host group in this case is not possible because the Oneagent is running in the container and not in full-stack.

We have a workaround that can help. You can use [DT\_CUSTOM\_PROP](https://www.dynatrace.com/support/help/shortlink/process-group-properties#variables)&nbsp;environment variable to equal your host group. It will show on the processes, then you could use a auto tagging rule to propagate to the hosts.

Hope that helps.

Thanks,

Abraham

 ![abraham_villega_0-1636646793955.png](https://global.discourse-cdn.com/dynatrace/original/2X/8/8e008c8e6a79c4717da15735e2f3503a7fd41ddb.png)

 ![abraham_villega_1-1636646813825.png](https://global.discourse-cdn.com/dynatrace/original/2X/d/db0418d436b8cbe2e409295e7f21c22037057a57.png)

---

<div class="post-metadata">

**Author:** ![rodrigo\_alvare1](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/rodrigo_alvare1/32/1927_2.png) [@rodrigo\_alvare1](https://community.dynatrace.com/u/rodrigo_alvare1)\
**Post date:** [November 11, 2021, 4:47pm UTC](https://community.dynatrace.com/t/dockerfile-x-hostgroup/33256/3 "2021-11-11T16:47:49Z")

</div>

I agree with the solution provided by Abraham, had this issue in the past and the HOST\_GROUP/--set-host-group flag was not supported on docker container

Im pretty sure that was listed as one of the limitations in this list but I cannot see it anymore (I’m also talking with docs team to update it) [Set up Dynatrace OneAgent as a Docker container — Dynatrace Docs](https://www.dynatrace.com/support/help/shortlink/oneagent-docker#limitations)

The workaround I used was DT\_TAGS and DT\_CUSTOM\_PROP environment variables

---

<div class="post-metadata">

**Author:** ![RodrigoBiaggio](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/rodrigobiaggio/32/39343_2.png) [@RodrigoBiaggio](https://community.dynatrace.com/u/RodrigoBiaggio)\
**Post date:** [November 11, 2021, 4:57pm UTC](https://community.dynatrace.com/t/dockerfile-x-hostgroup/33256/4 "2021-11-11T16:57:13Z")

</div>

Hi guys, thanks for the reply.

Just one more doubt.

Should I pass this parameter as an ARG in my dockerfile, like:  
ARG DT\_CUSTOM\_PROP = “Platform”

Thanks

---

<div class="post-metadata">

**Author:** ![rodrigo\_alvare1](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/rodrigo_alvare1/32/1927_2.png) [@rodrigo\_alvare1](https://community.dynatrace.com/u/rodrigo_alvare1)\
**Post date:** [November 11, 2021, 5:12pm UTC](https://community.dynatrace.com/t/dockerfile-x-hostgroup/33256/5 "2021-11-11T17:12:47Z")

</div>

Cant remember if ENV or ARG (or if any of those will work), the syntax would be :

ENV DT\_CUSTOM\_PROP=“myCustomProp”  
ARG&nbsp;DT\_CUSTOM\_PROP=“myCustomProp”

also you can pass it with key:value format:  
DT\_CUSTOM\_PROP=“App=springbootdemo”

and multiple values  
DT\_CUSTOM\_PROP=“App=springbootdemo Environment=Dev”

---

<div class="post-metadata">

**Author:** ![DanielS](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@DanielS](https://community.dynatrace.com/u/DanielS)\
**Post date:** [March 6, 2023, 5:33pm UTC](https://community.dynatrace.com/t/dockerfile-x-hostgroup/33256/6 "2023-03-06T17:33:44Z")

</div>

Thanks, this is a great solution, I updated the image for tags because change a little.

 ![DanielS_0-1678124009923.png](https://global.discourse-cdn.com/dynatrace/original/3X/0/2/025b9fac511f8b34fe288c5bcffb6873d525b16e.png)

Also when you choose “Custom metadata” choose the one for Process Group not host.

---

<div class="post-metadata">

**Author:** ![Scott\_McMahon](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/scott_mcmahon/32/36865_2.png) [@Scott\_McMahon](https://community.dynatrace.com/u/Scott_McMahon)\
**Post date:** [August 14, 2023, 4:04pm UTC](https://community.dynatrace.com/t/dockerfile-x-hostgroup/33256/7 "2023-08-14T16:04:59Z")

</div>

Hey!

If you pass as ARG does that still work? I can’t see how Dynatrace could detect the DT\_CUSTOM\_PROP values if ARG values are only available at runtime?

I was thinking it would be ENV DT\_CUSTOM\_PROP but my development team are unsure.

---

<div class="post-metadata">

**Author:** ![DanielS](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@DanielS](https://community.dynatrace.com/u/DanielS)\
**Post date:** [August 14, 2023, 4:30pm UTC](https://community.dynatrace.com/t/dockerfile-x-hostgroup/33256/8 "2023-08-14T16:30:00Z")

</div>

Hello [@Scott\_McMahon](https://community.dynatrace.com/user/59720) please see this [post](https://community.dynatrace.com/topic/212531).
