# Why do I need ENV container docker?

**URL:** <https://forums.balena.io/t/why-do-i-need-env-container-docker/22595>\
**Category:** Product support\
**Tags:** raspberrypi3\
**Created:** [July 26, 2019, 5:25pm UTC](https://forums.balena.io/t/why-do-i-need-env-container-docker/22595 "2019-07-26T17:25:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kml001](https://avatars.discourse-cdn.com/v4/letter/k/91b2a8/32.png) [@kml001](https://forums.balena.io/u/kml001)\
**Post date:** [July 26, 2019, 5:25pm UTC](https://forums.balena.io/t/why-do-i-need-env-container-docker/22595/1 "2019-07-26T17:25:37Z")

</div>

Hello, other than suppress the systemd output on the console logs, why do I need to have the following statement in my Docker.template file?

ENV container docker

Does it actually serve a functional purpose pass log output?

---

<div class="post-metadata">

**Author:** ![shaunmulligan](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/shaunmulligan/32/34_2.png) [@shaunmulligan](https://forums.balena.io/u/shaunmulligan)\
**Post date:** [July 26, 2019, 5:29pm UTC](https://forums.balena.io/t/why-do-i-need-env-container-docker/22595/2 "2019-07-26T17:29:59Z")

</div>

Hi @kml001 I think that ENV is needed to allow systemd to start up correctly in a container. I think if you removed it, systemd would not behave correctly.

---

<div class="post-metadata">

**Author:** ![kml001](https://avatars.discourse-cdn.com/v4/letter/k/91b2a8/32.png) [@kml001](https://forums.balena.io/u/kml001)\
**Post date:** [July 26, 2019, 5:34pm UTC](https://forums.balena.io/t/why-do-i-need-env-container-docker/22595/4 "2019-07-26T17:34:13Z")

</div>

Thanks for the suggestion, however, I have not observed any ill effects and it seems to function OK without it. Can we find any more detail?

---

<div class="post-metadata">

**Author:** ![shaunmulligan](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/shaunmulligan/32/34_2.png) [@shaunmulligan](https://forums.balena.io/u/shaunmulligan)\
**Post date:** [July 26, 2019, 5:40pm UTC](https://forums.balena.io/t/why-do-i-need-env-container-docker/22595/5 "2019-07-26T17:40:16Z")

</div>

It might not have very large impact. I found the following:

> To allow systemd (and other code) to identify that it is executed within a container, please set the $container= environment variable for PID 1 in the container to a short lowercase string identifying your implementation. With this in place the ConditionVirtualization= setting in unit files will work properly. Example: “container=lxc-libvirt”

From [ContainerInterface](https://www.freedesktop.org/wiki/Software/systemd/ContainerInterface/)
