You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Regarding the top-level configuration (i.e. Configure the restart-policy for all services), there's another topic that discusses setting global/project-settings here #463
That PR uses project-config for global, project-wide settings. It would be nice to use the same approach here.
I am trying to use restart option to fig as "restart: always ". But getting thrown back the error message "Unsupported config option for web service: 'restart'" . Is it already part of 1.0.1 release or need to added manually as a patch ?
@heeren-cliqz it looks like 1.0.1 was release Nov 5, 2014 and this feature was merged in on December 9...so it's not in the 1.0.1 release as far as I can tell.
Well I tried killing the process as well, but container is not restarting back. I think someone didn't test this behavior or there is more required than simply specify in fig file:
restart: always
Any ideas?
Have you tried creating/starting the container directly with docker and kill it? Is the behavior the same?
IIRC, restart:always should automatically restart the container when the docker daemon is restarted. So you could create two containers, on with and one withoutrestart:always, then stop and start the daemon. Only the container with restart:always should be running after that.
Thanks @thaJeztah. After inspecting my docker containers, indeed the restart policies are changed as per specified criteria.
"RestartPolicy": {
"MaximumRetryCount": 0,
"Name": "always"
},
I think it is more or less the problem with boot2docker as it is not persistent by default and hence when restarted, state of containers are not consistent. Correct me if I am wrong.
I don't use Boot2docker, but that could of course be a factor. Still keep in mind that fig stop container_nameshould just stop the container (because you told it to stop), but restarting the docker daemon, or if the process inside the container bails out, docker should try to start it again if a restart:always policy is set. (and keep trying to start it again, every 100ms, 200ms, 400ms and so on)
^^ @SvenDowideit (if you have time); Can you tell if boot2docker persistence makes a difference here?
I also noted that the incrementing interval is not mentioned in the restart policies docs. I think that should be added somewhere, perhaps that whole section should be moved to the Docker run reference so that it can be explained more in depth?
I'm happy to create a PR for that if you think it's a good idea.
Activity
andrewortman commentedon Sep 18, 2014
+1
thaJeztah commentedon Sep 18, 2014
Regarding the top-level configuration (i.e. Configure the restart-policy for all services), there's another topic that discusses setting global/project-settings here #463
That PR uses
project-configfor global, project-wide settings. It would be nice to use the same approach here.Add restart option to Fig. Related to docker#478
Add restart option to Fig. Related to docker#478
!fixup Add restart option to Fig. Related to docker#478
Add restart option to Fig. Related to docker#478
Add restart option to Fig. Related to docker#478
Add restart option to Fig. Related to docker#478
Add restart option to Fig. Related to docker#478
Add restart option to Fig. Related to docker#478
Add restart option to Fig. Related to docker#478
Add restart option to Fig. Related to docker#478
Add restart option to Fig. Related to docker#478
Add restart option to Fig. Related to docker#478
Add restart option to Fig. Related to docker#478
15 remaining items
heeren-cliqz commentedon Dec 28, 2014
I am trying to use restart option to fig as "restart: always ". But getting thrown back the error message "Unsupported config option for web service: 'restart'" . Is it already part of 1.0.1 release or need to added manually as a patch ?
tomkersten commentedon Jan 7, 2015
@heeren-cliqz it looks like 1.0.1 was release Nov 5, 2014 and this feature was merged in on December 9...so it's not in the 1.0.1 release as far as I can tell.
heeren-cliqz commentedon Jan 7, 2015
@tomkersten Can you suggest me how to use restart feature?
pip install git+https://github.com/docker/fig.git@master#egg=fig-master
I tried to get the latest code but it doesn't seem to work.
dnephin commentedon Jan 7, 2015
What doesn't work?
heeren-cliqz commentedon Jan 7, 2015
restart option. Sorry not to be precise. I stop one container by issuing "fig stop container_name". But it didn't start after that.
dnephin commentedon Jan 7, 2015
I haven't used restart policies much myself, but I believe that is the expected behaviour (otherwise you'd never be able to stop the container).
I would try killing the process instead, to see if it restarts.
heeren-cliqz commentedon Jan 7, 2015
Well I tried killing the process as well, but container is not restarting back. I think someone didn't test this behavior or there is more required than simply specify in fig file:
restart: always
Any ideas?
thaJeztah commentedon Jan 7, 2015
Have you tried creating/starting the container directly with docker and kill it? Is the behavior the same?
IIRC,
restart:alwaysshould automatically restart the container when the docker daemon is restarted. So you could create two containers, on with and one withoutrestart:always, then stop and start the daemon. Only the container withrestart:alwaysshould be running after that.heeren-cliqz commentedon Jan 8, 2015
Thanks @thaJeztah. After inspecting my docker containers, indeed the restart policies are changed as per specified criteria.
"RestartPolicy": {
"MaximumRetryCount": 0,
"Name": "always"
},
I think it is more or less the problem with boot2docker as it is not persistent by default and hence when restarted, state of containers are not consistent. Correct me if I am wrong.
thaJeztah commentedon Jan 8, 2015
I don't use Boot2docker, but that could of course be a factor. Still keep in mind that
fig stop container_nameshould just stop the container (because you told it to stop), but restarting the docker daemon, or if the process inside the container bails out, docker should try to start it again if arestart:alwayspolicy is set. (and keep trying to start it again, every 100ms, 200ms, 400ms and so on)A nice blog about the restart-policies can be found here; http://www.tech-d.net/2014/09/30/docker-restart-policies/
^^ @SvenDowideit (if you have time); Can you tell if boot2docker persistence makes a difference here?
I also noted that the incrementing interval is not mentioned in the restart policies docs. I think that should be added somewhere, perhaps that whole section should be moved to the Docker run reference so that it can be explained more in depth?
I'm happy to create a PR for that if you think it's a good idea.
Add restart option to Fig. Related to docker#478
praveennous commentedon Aug 11, 2015
Hello All,
Could some one give me steps how to set existing container to restart=always to autostart.Please find my image id and guide me on this.
Image ID :e0418b2f81b4
Fix CircleCI job to publish container images (docker#478)