Answers: <p>Here are a short description of the docker commands above :</p>
  <ul>
  <li>docker run : starts a docker container from the given image name ;</li>
  <li>docker exec : runs a program inside a running container;</li>
  <li>docker start : restart a stopped container by relaunching the initial command;</li>
  </ul>
  <p>You should definitivly try the last one ;-)</p>
  
Answers: CC BY-SA 4.0
Answers: 2022-01-26T17:19:41.090Z
Answers: Thank you for your response. docker start lucid_ride echo "hello from lucid_ride" produces the following error. I can continuously run busybox with no problem and keep getting new names shown in docker ps -a. But, I cannot start, exec or run any using any of the names (e.g lucid_ride).
Answers: user2220115
Answers: CC BY-SA 4.0
Answers: 2022-01-26T19:12:23.950Z
Answers: You juste need to execute "docker start -a lucid_ride" and it will run the echo command again.
Answers: Karim DRIDI
Answers: CC BY-SA 4.0
Answers: 2022-01-26T17:07:19.317Z
Answers: 2022-01-26T17:07:19.317Z
Answers: Karim DRIDI
Body: <p>I ran docker run busybox a few times with success.</p>
  <pre><code>docker run busybox echo &quot;hello from busybox&quot;
  </code></pre>
  <p>Output:</p>
  <pre><code>hello from busybox
  </code></pre>
  <p>docker ps -a shows the following:</p>
  <pre><code>CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                         PORTS               NAMES
  59be6eaee13e        busybox             &quot;echo 'hello from bu…&quot;   2 minutes ago       Exited (0) 2 minutes ago                           lucid_ride
  2d1a63cfd696        busybox             &quot;echo 'hello from bu…&quot;   4 minutes ago       Exited (0) 4 minutes ago                           quizzical_engelbart
  69804c9b7db5        busybox             &quot;echo 'hello from bu…&quot;   49 minutes ago      Exited (0) 49 minutes ago                          focused_clarke
  65c371540c5d        busybox             &quot;echo 'hello from bu…&quot;   59 minutes ago      Exited (0) 59 minutes ago                          charming_merkle
  2fc6bd074048        busybox             &quot;sh&quot;                     About an hour ago   Exited (0) About an hour ago                       nice_noyce
  </code></pre>
  <p>Trying to use either docker run or docker exec with the name in the Names column instead of the imange name busyboxy.</p>
  <pre><code>docker run lucid_ride echo &quot;hello from lucid_ride&quot;
  </code></pre>
  <p>Output:</p>
  <pre><code>docker: Error response from daemon: pull access denied for lucid_ride, repository does not exist...
  </code></pre>
  <p>Using exec:</p>
  <pre><code>docker exec -it lucid_ride echo &quot;hello from lucid_ride&quot; 
  </code></pre>
  <p>Output:</p>
  <pre><code>Error response from daemon: Container 59be6eaee13e4089a5abcccee7fa4778f8b76332e15a0dc2f698057c0368f95f is not running
  </code></pre>
  <p>So, I can run docker run busybox all day and have instances show up in the results of the docker ps -a.
  But, when I try to use any of the names in the Names column (either with exec or run) it doesn't work. Why is this? Thank you.</p>
  
Tags: <docker>
Title: docker exec and docker run do not work with names
UserDisplayName: user2220115
ThreadText: # docker exec and docker run do not work with names
  
  (Asked by: username_0 on 2022-01-26)
  
  I ran docker run busybox a few times with success.
  
  ```
  docker run busybox echo "hello from busybox"
  
  ```
  
  Output:
  
  ```
  hello from busybox
  
  ```
  
  docker ps -a shows the following:
  
  ```
  CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                         PORTS               NAMES
  59be6eaee13e        busybox             "echo 'hello from bu…"   2 minutes ago       Exited (0) 2 minutes ago                           lucid_ride
  2d1a63cfd696        busybox             "echo 'hello from bu…"   4 minutes ago       Exited (0) 4 minutes ago                           quizzical_engelbart
  69804c9b7db5        busybox             "echo 'hello from bu…"   49 minutes ago      Exited (0) 49 minutes ago                          focused_clarke
  65c371540c5d        busybox             "echo 'hello from bu…"   59 minutes ago      Exited (0) 59 minutes ago                          charming_merkle
  2fc6bd074048        busybox             "sh"                     About an hour ago   Exited (0) About an hour ago                       nice_noyce
  
  ```
  
  Trying to use either docker run or docker exec with the name in the Names column instead of the imange name busyboxy.
  
  ```
  docker run lucid_ride echo "hello from lucid_ride"
  
  ```
  
  Output:
  
  ```
  docker: Error response from daemon: pull access denied for lucid_ride, repository does not exist...
  
  ```
  
  Using exec:
  
  ```
  docker exec -it lucid_ride echo "hello from lucid_ride" 
  
  ```
  
  Output:
  
  ```
  Error response from daemon: Container 59be6eaee13e4089a5abcccee7fa4778f8b76332e15a0dc2f698057c0368f95f is not running
  
  ```
  
  So, I can run docker run busybox all day and have instances show up in the results of the docker ps -a.
  But, when I try to use any of the names in the Names column (either with exec or run) it doesn't work. Why is this? Thank you.
  
  **Tags:** docker
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-01-26. Score: 1
  
  Here are a short description of the docker commands above :
  
  * docker run : starts a docker container from the given image name ;
  * docker exec : runs a program inside a running container;
  * docker start : restart a stopped container by relaunching the initial command;
  
  You should definitivly try the last one ;-)
  
  > **Comments:**
  > **username_0**: Thank you for your response. docker start lucid_ride echo "hello from lucid_ride" produces the following error. I can continuously run busybox with no problem and keep getting new names shown in docker ps -a. But, I cannot start, exec or run any using any of the names (e.g lucid_ride).  
  > **username_1**: You juste need to execute "docker start -a lucid_ride" and it will run the echo command again.  
  
  ---
  
  