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

Ability to force pull docker_image #54

Closed
gabrtv opened this issue Feb 3, 2014 · 8 comments
Closed

Ability to force pull docker_image #54

gabrtv opened this issue Feb 3, 2014 · 8 comments

Comments

@gabrtv
Copy link

gabrtv commented Feb 3, 2014

Once an image exists in the local graph, there seems to be no way to update it. It's common for an image's :latest tag to be updated on the registry. How can we ensure we always have the right :latest?

I have an in-progress PR that implements:

docker_image 'user/image' do
  action :pull
  force true
done

..but I wanted to get some feedback before moving forward.

@jayofdoom
Copy link
Contributor

Would it make sense for this to be a different action? :force_pull vs :pull? It seems almost analogous to the :create vs :create_if_missing with some of the other resources.

@jhulten
Copy link

jhulten commented Feb 3, 2014

+1 to :pull vs :pull_if_missing. Abstracting the docker cli should behave like the docker cli.

@bflad
Copy link
Contributor

bflad commented Feb 3, 2014

+1 to separate action

On Mon, Feb 3, 2014 at 1:36 PM, Jeffrey Hulten notifications@github.comwrote:

+1 to :pull vs :pull_if_missing. Abstracting the docker cli should behave
like the docker cli.

Reply to this email directly or view it on GitHubhttps://github.com//issues/54#issuecomment-33984863
.

Brian Flad
http://about.me/bflad

@gabrtv
Copy link
Author

gabrtv commented Feb 3, 2014

Glad I asked! I'll work up the PR accordingly.

@bflad
Copy link
Contributor

bflad commented Feb 3, 2014

@gabrtv I'd be a fan of renaming current pull action to pull_if_missing. Thanks so much and let me know if you need any help.

@jhulten
Copy link

jhulten commented Feb 3, 2014

My PR does the following:

  • moves the existing pull action to pull_if_missing.
  • adds a new pull action that checks the hash of the label before and after to determine if the resource updated.

@gabrtv Hope we didn't work at cross purposes. I have the okay from my boss to improve this cookbook on company time.

@gabrtv
Copy link
Author

gabrtv commented Feb 3, 2014

@jhulten #55 looks great to me. The hash check is a nice feature.

@bflad and I were talking about how this problem really applies to more than :pull -- :build, for example, should really exhibit similar behavior. There's probably others.

@bflad
Copy link
Contributor

bflad commented Feb 4, 2014

I've merged #55 and released 0.28.0, which should fix this behavior. I'll create a separate issue for :build action. Feel free to create others as necessary.

@bflad bflad closed this as completed Feb 4, 2014
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

4 participants