# Container keep restarting

**URL:** <https://forums.docker.com/t/container-keep-restarting/39370>\
**Category:** General\
**Created:** [October 6, 2017, 5:40pm UTC](https://forums.docker.com/t/container-keep-restarting/39370 "2017-10-06T17:40:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kamiz](https://avatars.discourse-cdn.com/v4/letter/k/e274bd/32.png) [@kamiz](https://forums.docker.com/u/kamiz)\
**Post date:** [October 6, 2017, 5:40pm UTC](https://forums.docker.com/t/container-keep-restarting/39370/1 "2017-10-06T17:40:05Z")

</div>

Hi,  
I’m a beginner, and my goal is to create a container and be able to log in directly to execute commands. However, I have a problem. I create my image, I created a container from it. Once I try to connect, the container restarts in a loop.

Here is my Dockerfile :

```
FROM debian
MAINTAINER Kamiz

RUN apt-get -y update
CMD /bin/bash

```

On Portainer, I try to open a session :

![Capture](https://global.discourse-cdn.com/docker/original/3X/a/9/a9b0b27c9204503fd191173875ecbb4f718575e9.PNG)

Then, i have this message on Portainer :

`{"message":"Container d681deecb37a5b04e1b61c869c98873afdf99e62b6374238480203bdbeaab123 is restarting, wait until the container is running"}`

if I do not try to start a session, the container does not crash.  
What is wrong ?

---

<div class="post-metadata">

**Author:** ![kamiz](https://avatars.discourse-cdn.com/v4/letter/k/e274bd/32.png) [@kamiz](https://forums.docker.com/u/kamiz)\
**Post date:** [October 7, 2017, 1:17pm UTC](https://forums.docker.com/t/container-keep-restarting/39370/2 "2017-10-07T13:17:41Z")

</div>

Solved by launching the container with **-i -t** arguments 😃
