Skip to content

#7017 - Add container pinning#7523

Closed
cpuguy83 wants to merge 1 commit intomoby:masterfrom
cpuguy83:7017_container_pinning
Closed

#7017 - Add container pinning#7523
cpuguy83 wants to merge 1 commit intomoby:masterfrom
cpuguy83:7017_container_pinning

Conversation

@cpuguy83
Copy link
Member

Addresses #7017
Makes it so you can pass --pin to docker run so that you can't docker rm that container without also using --force
For example:

docker run -d -v /myData --pin --name my_data tianon/true
docker stop my_data # This isn't running, but for showcasing this, stop it
docker rm my_data # this will fail even though it's not running
docker rm --force my_data # this will work

Docker-DCO-1.1-Signed-off-by: Brian Goff cpuguy83@gmail.com (github: cpuguy83)

@vieux
Copy link
Contributor

vieux commented Aug 12, 2014

@cpuguy83 I like the feature, I'll review in a bit.

@thaJeztah
Copy link
Member

Thanks, Brian! Very welcome feature.

daemon/delete.go Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please us the string we send to the daemon instead of the container name ?

@vieux
Copy link
Contributor

vieux commented Aug 12, 2014

LGTM besides my comment

@cpuguy83
Copy link
Member Author

@vieux Fixed. Didn't even realize!

@vieux
Copy link
Contributor

vieux commented Aug 12, 2014

LGTM

@cpuguy83 cpuguy83 mentioned this pull request Aug 13, 2014
@crosbymichael
Copy link
Contributor

@shykes this one is for you please review

@SvenDowideit
Copy link
Contributor

Doc LGTM

@frank-dspeed
Copy link

Merge +1

@shykes
Copy link
Contributor

shykes commented Sep 1, 2014

Can you please stop assigning issues to others. Thanks.

On Saturday, August 30, 2014, Frank Lemanschik notifications@github.com
wrote:

Merge +1


Reply to this email directly or view it on GitHub
#7523 (comment).

daemon/delete.go Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for double space between pinned. and You.

@tiborvass
Copy link
Contributor

@cpuguy83 API docs need to be relocated to the 1.15 API section

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--pin

@cpuguy83 cpuguy83 force-pushed the 7017_container_pinning branch from d10ce4b to a4dd003 Compare September 17, 2014 00:59
@cpuguy83
Copy link
Member Author

Updated and rebased, PTAL

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this commandline a stray?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I must have copied the pattern from the doc underneath this one.
I'll remove

@cpuguy83 cpuguy83 force-pushed the 7017_container_pinning branch from a4dd003 to d08431c Compare September 19, 2014 22:54
@SvenDowideit
Copy link
Contributor

Docs LGTM - @jamtur01 @fredlf @ostezer

@jamtur01
Copy link
Contributor

Docs LGTM

Makes it so you can pass `--pin` to `docker run` so that you can't
`docekr rm` that container without also using `--force`
For example:

```
docker run -d -v /myData --pin --name my_data tianon/true
docker stop my_data # This isn't running, but for showcasing this, stop
it
docker rm my_data # this will fail even though it's not running
docker rm --force my_data # this will work
```

Docker-DCO-1.1-Signed-off-by: Brian Goff <cpuguy83@gmail.com> (github: cpuguy83)
@shykes
Copy link
Contributor

shykes commented Oct 18, 2014

@cpuguy83 sorry for the late feedback. I agree that we need better ways to mark containers as "special". For example in my case, after a host reboot I have trouble remembering which containers are "active" but just not running at the moment, vs. old stuff I just didn't get around to removing. So in a way I need the equivalent of "stars" in gmail.

But this feels very specific, I would prefer to find a more generic solution to the problem of "I need to organize my containers, and distinguish the important ones from the non-important ones". Maybe some people want multiple levels of importance for example.

So, I would prefer to focus on generic labels, which you could use to annotate your container in any way you want. For example anybody could experiment with a "pinning" system with something like:

docker label set mycontainer pinned=true

Over time we could promote official usage patterns by defining reserved label names.

Consider this a request for implementation :) In the meantime I'm going to close this one, sorry.

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

Successfully merging this pull request may close these issues.

9 participants