{"action":"closed","issue":{"url":"https://api.github.com/repos/garethr/garethr-docker/issues/93","labels_url":"https://api.github.com/repos/garethr/garethr-docker/issues/93/labels{/name}","comments_url":"https://api.github.com/repos/garethr/garethr-docker/issues/93/comments","events_url":"https://api.github.com/repos/garethr/garethr-docker/issues/93/events","html_url":"https://github.com/garethr/garethr-docker/issues/93","id":42632512,"number":93,"title":"pull latest container","user":{"login":"hackzilla","id":1474182,"avatar_url":"https://avatars.githubusercontent.com/u/1474182?v=3","gravatar_id":"","url":"https://api.github.com/users/hackzilla","html_url":"https://github.com/hackzilla","followers_url":"https://api.github.com/users/hackzilla/followers","following_url":"https://api.github.com/users/hackzilla/following{/other_user}","gists_url":"https://api.github.com/users/hackzilla/gists{/gist_id}","starred_url":"https://api.github.com/users/hackzilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackzilla/subscriptions","organizations_url":"https://api.github.com/users/hackzilla/orgs","repos_url":"https://api.github.com/users/hackzilla/repos","events_url":"https://api.github.com/users/hackzilla/events{/privacy}","received_events_url":"https://api.github.com/users/hackzilla/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2014-09-12T14:07:41Z","updated_at":"2015-04-18T10:36:05Z","closed_at":"2015-04-18T10:36:05Z","body":"I'm trying to figure out the best way to upgrade the docker containers using puppet.\r\n\r\nCurrently trying:\r\n```\r\n\tdocker::image { 'kohana-remove':\r\n\t  ensure  => 'absent',\r\n\t  image   => 'docker.ukwm.local:5000/ukwm/container',\r\n\t  require => Class['ukwm::packages::docker'],\r\n\t}\r\n    ->\r\n\tdocker::image { 'kohana-install':\r\n\t  ensure  => 'latest',\r\n\t  image   => 'docker.ukwm.local:5000/ukwm/container',\r\n\t  require => Class['ukwm::packages::docker'],\r\n\t}\r\n    ->\r\n\tdocker::run { 'kohana':\r\n\t  image           => 'docker.ukwm.local:5000/ukwm/container',\r\n\t  ports           => ['81:80', '2221:22'],\r\n\t  use_name        => true,\r\n\t  restart_service => true,\r\n\t  privileged      => false,\r\n\t}\r\n```\r\n\r\nWhich outputs:\r\n```\r\nError: docker rmi docker.ukwm.local:5000/ukwm/container returned 1 instead of one of [0]\r\nError: /Stage[main]/Stats::Backend::Kohana/Docker::Image[kohana-remove]/Exec[docker rmi docker.ukwm.local:5000/ukwm/container]/returns: change from notrun to 0 failed: docker rmi docker.ukwm.local:5000/ukwm/container returned 1 instead of one of [0]\r\nWarning: /Stage[main]/Ukwm::Backend::Kohana/Docker::Image[kohana-install]/Exec[docker pull docker.ukwm.local:5000/ukwm/stats-kohana]: Skipping because of failed dependencies\r\nWarning: /Stage[main]/Ukwm::Backend::Kohana/Docker::Run[kohana]/File[/etc/init/docker-kohana.conf]: Skipping because of failed dependencies\r\nWarning: /Stage[main]/Ukwm::Backend::Kohana/Docker::Run[kohana]/Service[docker-kohana]: Skipping because of failed dependencies\r\n```\r\n\r\nSo maybe an option of force ```docker rm -f <container>```\r\n\r\nWhat would be nicer, is if could notify run that the image has been update. Then it could stop, remove, and restart container.\r\n\r\nThis would be the command I'd use.\r\n```\r\n\tdocker::image { 'kohana-install':\r\n\t  ensure  => 'latest',\r\n\t  image   => 'docker.ukwm.local:5000/ukwm/container',\r\n\t  require => Class['ukwm::packages::docker'],\r\n\t}\r\n\r\n\tdocker::run { 'kohana':\r\n\t  image           => 'docker.ukwm.local:5000/ukwm/container',\r\n\t  ports           => ['81:80', '2221:22'],\r\n\t  use_name        => true,\r\n\t  restart_service => true,\r\n\t  privileged      => false,\r\n\t}\r\n```\r\n\r\n```docker run --rm``` could be added to accomplish some of that."}}