title: creating interactive docker image
body: <p>I am new to Docker and need some help. I want to make an interactive docker image for a c code. I have written a small c code for the same. The below is my c code: </p>
  
  <pre><code>**CODE:** 
  
  #include&lt;stdio.h&gt;
  #include&lt;stdlib.h&gt;
  int main()
  {
    int i,sum=0,n,num[10];
    printf("How many integers do you want to enter? ");
    scanf("%d",&amp;n);
    for(i=0;i&lt;n;i++)
    {
       scanf("%d",&amp;num[i]);
       sum+=num[i];
    }
    printf("Total Sum: %d\n",sum);
    printf("---------------------\n\n");
    return 0;
  }
  </code></pre>
  
  <p><strong>OUTPUT:</strong>
  How many integers do you want to enter? 3(User Input)<br>
  1 3 5(User Input)  </p>
  
  <h2>Total Sum: 9</h2>
  
  <pre><code>**DockerFile code**
            File: Dockerfile                             
  
  FROM debian:latest
  RUN mkdir -p /home/arup123/ExtendedAdd
  COPY . /home/arup123/ExtendedAdd
  CMD /home/arup123/ExtendedAdd/ExtendedAddition
  </code></pre>
  
  <h2>My Attempt</h2>
  
  <p>I thought we could create an interactive shell like bash shell within the current shell to take user input but i am getting "Segmentation fault (core dumped)"</p>
  
  <pre><code>docker build -t image1 .
  docker run -it --name image2 image1 /bin/bash 
  /# 3
  bash: 3: command not found
  /# 1 2 3
  bash: 1: command not found
  /# exit
  exit
  docker commit image2 myuser/myimage:2.1
  # docker run e2807f8b1966(image id of image1)
  Segmentation fault (core dumped)
  </code></pre>
  
  <p>Please do let me know where I am going wrong and how i could correct the same!<br>
  -Thank you</p>