# Docker Container does not restart when using --net=host

**URL:** <https://forums.docker.com/t/docker-container-does-not-restart-when-using-net-host/109476>\
**Category:** General\
**Tags:** docker, raspberrypi\
**Created:** [May 22, 2021, 12:01pm UTC](https://forums.docker.com/t/docker-container-does-not-restart-when-using-net-host/109476 "2021-05-22T12:01:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mu88](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/mu88/32/41992_2.png) [@mu88](https://forums.docker.com/u/mu88)\
**Post date:** [May 22, 2021, 12:01pm UTC](https://forums.docker.com/t/docker-container-does-not-restart-when-using-net-host/109476/1 "2021-05-22T12:01:40Z")

</div>

I have a little [ASP.NET](http://ASP.NET) Core application which runs fine within a Docker container on my Raspberry Pi 4. The command to start the container looks like this:

`docker run --net=host -d --env-file /home/<<user>>/Docker/EReader/ereader.env --name ereader --restart always mu88/ereader:latest`

As you can see, the container should restart on a system reboot (`--restart always`) and uses the daemon’s network (`--net=host`).

However, the container restart fails when rebooting the system. When running `docker ps -a`, the status of the container is `Restarting (132)` after the reboot.

I’ve tested some variations using the same image:

| combination of… | result after reboot |
| --- | --- |
| `--net=host` and `--env-file` | container stuck in `Restarting (132)` |
| `--net=host` and several `-e` arguments | container stuck in `Restarting (132)` |
| without `--net=host`, but with `--env-file` | works, but logic inside the container fails because of missing network |
| without `--net=host`, but with `-e` arguments | works, but logic inside the container fails because of missing network |

So it seems to be related to `--net=host`.

Is there any known bug? Or am I doing it the wrong way? Can I somehow analyze what’s going on and why the container stucks in `Restarting (132)`?
