Answers: <p>You can use a docker update.
  (<a href="https://docs.docker.com/engine/reference/commandline/update/" rel="nofollow noreferrer">https://docs.docker.com/engine/reference/commandline/update/</a>).</p>
  <p><code>docker update --restart always &lt;containerID&gt;/&lt;containerName&gt;</code>.</p>
  <p>Not sure about removing the --rm flag, though</p>
  
Answers: CC BY-SA 4.0
Answers: 2022-07-19T17:38:16.047Z
Answers: Welcome to the site Bryan, I'm sorry but this doesn't quite answer my question.   I know how to set the autostart parameters, but I'm pretty sure it doesn't help since the container is set to auto remove.
Answers: Peter Turner
Answers: CC BY-SA 4.0
Answers: 2022-07-19T17:33:29.290Z
Answers: 2022-07-19T17:33:29.290Z
Answers: Bryan Endres
Body: <p>I've got a container started (not my code, not my container, but I often manage the server and deal with the aftermath of it being patched) and I need to make a hot-fix to the deployment strategy, I had gone through the steps to change it to auto-restart, but a coworker noticed that the container was started with <code>--rm</code>.  My guess is that this is circumventing any attempt to start it up after reboots (because the container just isn't there any more)</p>
  <p>So is there a way to remove the <code>--rm</code> policy from a running container?</p>
  
Comments: CC BY-SA 4.0
Comments: 2022-07-20T09:00:13.777Z
Comments: the real answer here is - convince the docker owner to enable swarm mode and deploy as a service.
Comments: Chris Becke
Tags: <docker>
Title: Can I change a docker container from a self-delete policy to auto-restart?
UserDisplayName: Peter Turner
ThreadText: # Can I change a docker container from a self-delete policy to auto-restart?
  
  (Asked by: username_0 on 2022-07-19)
  
  I've got a container started (not my code, not my container, but I often manage the server and deal with the aftermath of it being patched) and I need to make a hot-fix to the deployment strategy, I had gone through the steps to change it to auto-restart, but a coworker noticed that the container was started with `--rm`. My guess is that this is circumventing any attempt to start it up after reboots (because the container just isn't there any more)
  
  So is there a way to remove the `--rm` policy from a running container?
  
  **Tags:** docker
  
  > **Comments:**
  > **username_1**: the real answer here is - convince the docker owner to enable swarm mode and deploy as a service.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2022-07-19. Score: 0
  
  You can use a docker update.
  (<https://docs.docker.com/engine/reference/commandline/update/>).
  
  `docker update --restart always <containerID>/<containerName>`.
  
  Not sure about removing the --rm flag, though
  
  > **Comments:**
  > **username_0**: Welcome to the site username_2, I'm sorry but this doesn't quite answer my question.   I know how to set the autostart parameters, but I'm pretty sure it doesn't help since the container is set to auto remove.  
  
  ---
  
  