Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with docker image remove #614

Open
parnamis opened this issue Dec 27, 2016 · 4 comments
Open

Issue with docker image remove #614

parnamis opened this issue Dec 27, 2016 · 4 comments

Comments

@parnamis
Copy link

Hi,

My intention is to remove old docker images from machine.

Trying to use
docker::image { 'base':
ensure => 'absent'
}
I see its executing block but doesn't actually removes the image mentioned in it, i have verified using notify statements before and after.

Is their anyway i can see some logs or find out what could be the issue ?
Please guide.

@LongLiveCHIEF
Copy link

Could you give us some debugging info? We need 3 things to really help here:

  1. Before running puppet, run docker images | grep <image_to_be_removed> and list the output here.
  2. Then paste in the puppet manifest you are running
  3. Repeat step 1 and paste the results

@parnamis
Copy link
Author

Thanks for your comment.
List of images on servers are
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
poc-docker-dc-001.company.net:5000/rep v1.0 f59a1b14b12d 4 weeks ago 581.9 MB
poc-docker-dc-001.company.net:5000/rep v0.1 3f112a053682 12 weeks ago 581.7 MB
I am trying to remove image with below ID passed, so grep wont return anything as its a combination of Repository and Tag.
docker images | grep poc-docker-dc-001.company.net:5000/rep:v0.1

docker rmi poc-docker-dc-001.company.net:5000/rep:v0.1 Works fine for me manually.

Please let me know if i am doing anything wrong ?

Code snippet from manifest

notify { "before versioncmp execution ${app_version} ${current_rep_app_version} " :}

if versioncmp("${app_version}", "${current_rep_app_version}") !=0  {
  notify {" versioncmp executed and removing image  ${oldImageVersion} " :}
  docker::image { $oldImageVersion :
   ensure => 'absent'
  }
}
notify { " after versioncmp execution " :}

Please see its added at the end of manifest file.

@parnamis
Copy link
Author

parnamis commented Jan 5, 2017

Any update on this ?

@gdubicki
Copy link

Maybe this will help #697 ?

cegeka-jenkins pushed a commit to cegeka/puppet-docker that referenced this issue Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants