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

docker_container resource not idempotent ? #27

Closed
0xAhmed opened this issue Nov 14, 2013 · 8 comments
Closed

docker_container resource not idempotent ? #27

0xAhmed opened this issue Nov 14, 2013 · 8 comments
Assignees

Comments

@0xAhmed
Copy link

0xAhmed commented Nov 14, 2013

Hi,

Thanks for the cookbook, I was wondering if it was not designed to be idempotent ?

I am basically using the docker_container resource, however with each chef run a new container is created !

Any hints ?

@ghost ghost assigned bflad Nov 15, 2013
@bflad
Copy link
Contributor

bflad commented Nov 15, 2013

It should be idempotent in most if not all use cases. Can you send a sample recipe where you're not seeing the correct behavior? I'd also like to see the DEBUG output if possible. Thanks

@0xAhmed
Copy link
Author

0xAhmed commented Nov 15, 2013

I am basically using it in an application/wrapper cookbook, just a simple recipe with the following content:

docker_container "docker-registry" do
    image "samalba/docker-registry"
    detach true
    hostname "xx.xx.xx.xx"
    port 5000
    env "SETTINGS_FLAVOR=local"
    volume "/mnt/docker:/docker-storage"
end

We're talking about DEBUG output of the chef-client here ?

@bflad
Copy link
Contributor

bflad commented Nov 16, 2013

Okay its not being idempotent because its currently using the command attribute to determine if it's running. I'll be able to take a look at this further tomorrow

@0xAhmed
Copy link
Author

0xAhmed commented Nov 17, 2013

I see, It's just that a lot of docker containers just bake the CMD in their Dockerfiles, that was my case.

Extra thanks.

@bflad
Copy link
Contributor

bflad commented Nov 17, 2013

I had written the cookbook before dockerfiles existed. Just need to account for the newer use cases.

@bflad
Copy link
Contributor

bflad commented Nov 18, 2013

This should be fixed in 0.14 of the cookbook, which I'm releasing now. Please test and let me know if this doesn't work still.

@0xAhmed
Copy link
Author

0xAhmed commented Nov 18, 2013

Awesome, will check it out now

@bflad
Copy link
Contributor

bflad commented Nov 20, 2013

Fixed in 0.14.0

@bflad bflad closed this as completed Nov 20, 2013
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

2 participants