created: 20150810153834598 creator: user modified: 20150810160033080 modifier: user tags: docker title: Restart docker container type: text/vnd.tiddlywiki The ~RestartPolicy is in the hostconfig, assuming a distro layout docker inspect --format="/var/lib/docker/containers/{{.Id}}/hostconfig.json" I'm not sure if you can use the API to overwrite the hostconfig (may be worth requesting a modify handler here) ```bash docker inspect --format="/var/lib/docker/containers/{{.Id}}/hostconfig.json" sudo cat /var/lib/docker/containers/596494fa04395fafad04e07160970a0848543fef5b961cf6a545481eaa69b200/hostconfig.json ``` ```json { "Binds":null, "ContainerIDFile":"", "LxcConf":[], "Privileged":false, "PortBindings":{ "8000/tcp":[ { "HostIp":"", "HostPort":"8000" } ] }, "Links":null, "PublishAllPorts":false, "Dns":null, "DnsSearch":null, "ExtraHosts":null, "VolumesFrom":null, "Devices":[], "NetworkMode":"bridge", "IpcMode":"", "CapAdd":null, "CapDrop":null, "RestartPolicy":{ "Name":"on-failure", "MaximumRetryCount":0 }, "SecurityOpt":null } ``` You can just remove the ~RestartPolicy from the hostconfig.json after you've run docker kill but clearly that's not a supported way, but may get you out of this.