-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Add an explicit noop option for minimal containers that do not have echo #517
Conversation
Signed-off-by: Christopher Knox <chris@dragonfly.co.nz>
👍 Thanks for tackling this issue! |
It looks like This only changes an intermediate container, which I don't think is ever started, so I'm not sure this is doing what you expect. If you want to have a data volumes container, you can set |
@dnephin |
I was also not sure why recreate existed. I believe it is so that the new container has the same name, while still supporting What I'm saying is that I believe if your service has an
Which I believe is the same as what you're proposing, just without having to make any code changes. Does this not work? I would think that since the intermediate container never runs, it doesn't really matter what's in the entrypoint? Maybe you'd still have to make a smaller code change? (use |
Ok, right. But you can probably still fix this with the one line change right? (on the intermediate container) entrypoing=self.options.get('entrypoint', ['echo']), That way setting the entrypoint will be preserved from the yaml. |
@dnephin this is where |
I don't see how that's an assumption. What you're actually doing is setting an |
@dnephin what you are proposing was my initial solution. However I then realised that that would break the recreate behaviour when using volumes-from on a container with a real entry-point - e.g.
The standard library postgres image defines an entrypoint which starts postgres which should not be run during the recreate phase when a user just wants access to the volumes. |
I see what I was missing. |
👍 for this. We just gotten bitten by it. |
👍 . /cc @tianon |
I wonder if starting the container is still necessary too. I wonder if we could also use a small image with a known executable in it. /cc @aanand |
I tried the test suite without the start and wait. There was a volume on the recreated container, but it had a different id. I haven't tried a volume with files to see if the files match. I like the idea of a small image with known executable. I was also thinking that if docker supported removing the name from a container you would be able to do this recreate without the need for an intermediate container. |
The current behaviour is hacky as hell, and while I appreciate the need for a solution to the no-op problem, I'm nervous about adding one more hack to the tower. Could we dispose with We'd need to decide what to do when users make changes to a service's |
Looks like volumes_from moved from create to start in 0.10.0: 80991f1 |
@aanand that sounds like a good idea. |
@dnephin @jpetazzo @nathanleclaire How major do you think this problem is? How did you get bitten by it? Do you think it's a blocker for 1.0.0? |
I have not had a problem with it. I build data volumes on Seems to me like the workaround is easy enough (use busybox instead of scratch). I believe the busybox image is only 2.4M, which seems like negligible overhead. I would say not a blocker personally (I just thought the issue was interesting!). |
This would work for |
(and I plan to make more of them in the future, and hopefully help make them easier to create so other people make more of them, too) |
I got bitten by it while using sleeping-beauty for an "environment IMHO, we could use busybox (or something like tianon/true) for the On Thu, Oct 9, 2014 at 8:16 AM, Tianon Gravi notifications@github.com
@jpetazzo https://twitter.com/jpetazzo |
If the builtin |
That sounds like a good short-term solution to me (change to |
In cases where the service is using a minimal container, /bin/echo can be created but echo cannot. See docker#517 Signed-off-by: Ben Firshman <ben@firshman.co.uk>
In cases where the service is using a minimal container, /bin/echo can be created but echo cannot. See docker#517 Signed-off-by: Ben Firshman <ben@firshman.co.uk>
+1 #534 |
The problem with using |
In cases where the service is using a minimal container, /bin/echo can be created but echo cannot. See docker#517 Signed-off-by: Ben Firshman <ben@firshman.co.uk>
Out of curiosity: what's wrong with pulling busybox? On Fri, Oct 10, 2014 at 3:13 AM, Ben Firshman notifications@github.com
@jpetazzo https://twitter.com/jpetazzo |
@jpetazzo Nothing – it sounds like a good plan. I just wanted to get the simplest possible fix in for 1.0.0, then we can do a proper fix for 1.0.1. It's a little complex because we don't want to pull busybox on every recreate, so there has got to be some intelligence there. Perhaps just trying to create the container, then if busybox doesn't exist, pulling it. Still, much more complex than 4 extra characters. ;) |
If you try to run it and it isn't there, won't the Daemon just auto-pull it? |
@tianon Nope, that's done client-side! |
Pretty sure I just threw up in my mouth, but I definitely believe you. |
Just hit this issue with an image that doesn't have /bin/echo. Using a known image for the intermediate container sounds like the best solution to me. |
I just hit this issue as well -- my data container uses |
👍 Just got bitten by it. Using |
|
I agree |
In cases where the service is using a minimal container, /bin/echo can be created but echo cannot. See docker#517 Signed-off-by: Ben Firshman <ben@firshman.co.uk> Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
In order to support data only volumes using minimal images #514 I have added an option that allows a no-op command to be explicitly specified - currently it is assumed to be echo which isn't necessarily available on a minimal image.
I have added a test and updated the documentation.
I am concerned that this approach essentially exposes an internal feature ...